/    Sign up×
Community /Pin to ProfileBookmark

Javascript error

I’m having a problem with a Javascript function

hard coded it works (some Ip is my company’s ip address)
var net = new ActiveXObject(“wscript.network”);
net.MapNetworkDrive(“K:”, “some ipWSAProjects”);

But, what I’m doing is getting the values for the drive and path from a web form, when I do that, I get a errors, no matter what I do. I get either “Wrong number of arguments” error or “wrong number of arguments or invalid property assignment”

this is an example of how I get the values, when I put them in an alert, their coming across just fine.

var drive = cell[1].innerHTML + ‘:’;
var path = cell[3].innerHTML;

now the var drive and path have what I need, but no matter how I pass them to the function, it does not work. I’ve tried:

net.MapNetworkDrive(drive,path);
net.MapNetworkDrive(drive + ‘, ‘ + path);
var str = ‘”‘ + drive + ‘”‘ + ” , ” + ‘”‘ + path + ‘”‘;
net.MapNetworkDrive(str);

These don’t works, but hard coding does work.

Can someone help me here?

Taffy

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @TaffyLewis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...