MapNetworkDrive local/remote

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello,

I've a script that does a few things and then maps a network drive
using the following code:

objWshNetwork.MapNetworkDrive "T:", "\\server\share", False, "user",
"password"
'objWshShell.Run "net use T: \\server\share /U:user password /
PERSISTENT:NO"
'objWshShell.Run "C:\mountShare.bat"

If (Err.Number <> 0) Then
LogAction "Failed to mount network share (Err.Number=" & Err.Number &
")"
Else
LogAction "Mounted network share"
End If

When I run it locally when I'm logged to the machine's desktop it
works just fine but when I fire the script through
Win32_Process.Create over WMI the script simply dies right when it was
supposed to mount the drive.

The other two lines that are commented out are my attempts to try to
mount it in a different way ("net use" direcly and thru a batch file).
All of them work when I'm local, but fail remotely.

Is there anything that I'm missing ?

There rest of the script works just fine if I comment that code.
What's different between local and remote/WMI that I should be looking
at ?

Thanks,

Giovanni Tirloni
.



Relevant Pages

  • Re: netatalk, NFS, OS X and backup
    ... Personally I use a combination of applescript and cli. ... With applescript you create a script that mounts the remote afp volume. ... Personally I put the mount command inside the try block to prevent error ...
    (freebsd-questions)
  • Cron Runs Script Twice - Once With Error and Once Without?
    ... I have a script that runs from cron. ... on another machine, copies some files from it, and then unmounts the ... The success email is just as I'd expect but I don't ... Unable to mount /blacklamb. ...
    (freebsd-questions)
  • Re: Managing various removable FAT drives
    ... The script is called as " usbmount ... This script can be run as user, because I have generic entries in ... they do not have a FAT filesystem the user will be unable to mount ... University of Cambridge, Zoology Department, Downing Street, CAMBRIDGE CB2 3EJ ...
    (comp.os.linux.misc)
  • Re: Need help with backup shell script
    ... full backup of /backup on my server once or ... The script must be able to ... mount usb_drive $MOUNT ... USB support and SCSI/da support in my previous kernel. ...
    (freebsd-questions)
  • Re: f8 boots!
    ... Seriously, whatever script processes the fstab and assembles the system, needs ... erroneous mount operation is much preferable in such a case. ... whose line contains the noauto keyword. ...
    (Fedora)