
09-10-2009
|
|
|
|
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Re: Credentialing
I found this solution on another forum
Create a text file with the .vbs extension and place it
C:\Users\username\AppData\Roaming\Microsoft\Window s\Start Menu\Programs\Startup
Set objNet = CreateObject("WScript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\.\root\default:StdRegProv")
If objFSO.DriveExists("Z:") Then
objNet.RemoveNetworkDrive "Z:",True,True
End If
If objFSO.DriveExists("Z:") Then
objReg.DeleteKey HKCU, "Network\" & Left("Z:", 1)
End If
objNet.MapNetworkDrive "Z:", "\\server\sharename", , "domain\username", "password"
Set objNet = Nothing
Set objFSO = Nothing
Set objReg = Nothing
NOTE: Change the drive letter, server, share name, domain, user name, password and you need. You can add as many drive mappings as you need, subject to available drive letters. Just copy these lines and modify as necessary.
If objFSO.DriveExists("Z:") Then
objNet.RemoveNetworkDrive "Z:",True,True
End If
If objFSO.DriveExists("Z:") Then
objReg.DeleteKey HKCU, "Network\" & Left("Z:", 1)
End If
objNet.MapNetworkDrive "Z:", "\\server\sharename", , "domain\username", "password"
|