Link to home
Start Free TrialLog in
Avatar of InsightMedia
InsightMedia

asked on

Using Languard and VBscript

I am using languard to run a vbscript that will temporarily map a drive and then remove the mapped drive.  When I run the script locally, it runs without a hitch.  When I push the script to another machine, I get a "800700005 Access denied error".  The error occurrs on the line where the MapNetworkDrive method exists.  My script is below.  I've tried using different credentials, but it doesn't matter. I get the same results.  Any help would be appreciated.

Dim WSHNetwork

Set WSHNetwork = WScript.CreateObject("WScript.Network")

WSHNetwork.MapNetworkDrive "G:", "\\ima4\netlogon\manualupdates"


Const OverwriteExisting = TRUE

Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "g:\scx2kpx.xslt" , "C:\STRATA\VIEW32\Users\NS000000\scx2kpx.xslt", OverwriteExisting


WSHNetwork.RemoveNetworkDrive "G:"
Avatar of EDDYKT
EDDYKT
Flag of Canada image

does net use work for you?
Avatar of InsightMedia
InsightMedia

ASKER

Well, yes & no.  The batch file would be much less complicated, I admit.

I originally created a batch file thtat contained "net use g: \\ima4\netlogon\manualupdates" (which operated seemlessly), but I ran into a snag using the xcopy command.  I want the script/batch file to execute w/no interaction from the users.

The xcopy command prompts to "create file or directory" & prompts overwrite protection.  I know that both of these are supposed to have the ability to be disabled with /I and /Y respectively, but the "/I" doesn't seem to work.  I even tried "Echo /I|xcopy" with no luck.  That issue prompted to switch to a scripting method, which works flawlessly when excuted at the desktop but not when being pushed to the desktop.

Any tips here?  Am I making this too complicated?  Am I overlooking something here?  I am getting down to the wire & need to push this out.
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I didn't know about "COMPSPEC".  I had to add credentials to the net use command & deleted the drive after copying the file.  After that, it worked great!  Thanks for your help!!