Link to home
Start Free TrialLog in
Avatar of nfoods
nfoods

asked on

Remotely mapping a drive for a user

Does anyone know a way to do the following using vbscript or similar?

  We often get requests to map drives or printers for users,
  I've written a VBscript that lets me connect someone to a printer without actually touching their PC (using rundll32 printui.dll),

  I want to do the same thing for drive mappings:
  I want to sit at PC#1 and run a script that connects PC#2 to a drive on Server #3

  I could do it by changing the login script, but I'm looking for a way to do one-off drive mappings without touching the user's PC,

Does anyone know of a way to do this?

Thanks
Keith
Avatar of KVR_Solutions
KVR_Solutions
Flag of United States of America image

This is pretty simple:

If you are in a domain environment or have administrative rights, you can specify a batch file to run at logon or to be placed in the startup folder. You wouldn't need to touch everyones PC.


I typically call it something like, "startup.bat" and the contents would look something like this:

net use Z: /delete

net use Z: \\server\share /u:Administrator "passwordhere"

exit

(I've found that using the delete command first typically helps the phone to not ring as much.

Hope this helps,

Ira @ KVR
SOLUTION
Avatar of KVR_Solutions
KVR_Solutions
Flag of United States of America 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
Avatar of nfoods
nfoods

ASKER

Yes we're on a domain,
I was hoping there was a way to force a drive mapping without having to log the user off/back on
but I've looked everywhere and don't think there is a way of doing it, other than write a quick batch file, drop it on the user's desktop and telling them to run it
ASKER CERTIFIED SOLUTION
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
Avatar of nfoods

ASKER

Thanks for your helps on this - I've found a way of doing it,

write a batch file to map the drive (persistent)
drop it on the user's C drive
then run a remote CMD on their machine and run the batch file

not quite as clean as I was hoping - but it achieves what I wanted.

Thank you for your help