Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non Domain, Map Network drives script

Status
Not open for further replies.

delfinko

IS-IT--Management
Jan 4, 2011
2
US
I am trying to create a script so that non domain users can map network drives (FYI, I haven't really spent any time with creating scripts so I know close to nothing about them). I found this thread ( ) which seems to have me started in the right direction. I am using the suggested script of:

set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "runas /user:domain\username ""wscript.exe C:\test\test.vbs"""

Which references test.vbs:
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "F:" , "\\server\share"

I am successfully prompted for the password, and I am using the correct login information but it is showing that I am entering incorrect credentials.

Any thoughts on what else I can try? Or is what I am attempting to do not possible?

Thanks in advance,
 
the mapnetworkdrive method takes a parameter for the username and password, no need for the runas stuff

object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword])


I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top