before going ahead you need to check it out does your drive is being mapped or not for that use the following code
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\veisbs\HP LaserJet 8150 PS"
objNetwork.AddWindowsPrinterConnection "\\Homer1\7520_PCL"
objNetwork.AddWindowsPrinterConnection "\\Homer1\7520_ps"
objNetwork.AddWindowsPrinterConnection "\\Homer1\hp4100"
objNetwork.AddWindowsPrinterConnection "\\Homer1\HP7500"
objNetwork.AddWindowsPrinterConnection "\\6L8D3F1\DYMO LabelWriter 330 USB"
objNetwork.AddWindowsPrinterConnection "\\D1DHH061\DYMO LabelWriter 400 "
strDriveLetterI = "I:"
strDriveLetterW = "W:"
strRemotePath2 = "\\veisbs\data1"
strRemotePath3 = "\\veisbs\data1\product\Cases - Electronic Docs"
If objFSO.DriveExists(strDriveLetterI) = True Then objNetwork.RemoveNetworkDrive strDriveLetterI, True
If objFSO.DriveExists(strDriveLetterW) = True Then objNetwork.RemoveNetworkDrive strDriveLetterW, True
WScript.Sleep 1000
objNetwork.MapNetworkDrive strDriveLetterI, strRemotePath2
objNetwork.MapNetworkDrive strDriveLetterW, strRemotePath3
At the same time also check the below link too
http://forums.techarena.in/server-scripting/1139356.htm
Bookmarks