Hi. I want to be able to map some printer and drive shares in the users logon script (WSH). The code below has no problem with the drive, however an error is returned when the printer is mapped. It says that the printer name is invalid.
If I copy the "\\dcs-hermes\HP LaserJet 2100" part on its own and stick it in any computers command prompt I get the que. I have triple-double checked the share name and have tried to make it 16bit compatible by changing the name to LJ2100 with no luck.
It is connected to the domain controller running Win2k and AD on lpt1.
Any help would be appreciated.
If I copy the "\\dcs-hermes\HP LaserJet 2100" part on its own and stick it in any computers command prompt I get the que. I have triple-double checked the share name and have tried to make it 16bit compatible by changing the name to LJ2100 with no luck.
It is connected to the domain controller running Win2k and AD on lpt1.
Code:
set WshNetwork = CreateObject ("Wscript.Network")
WshNetwork.AddWindowsPrinterConnection "lpt2", "\\dcs-hermes\HP LaserJet 2100"
WshNetwork.MapNetworkDrive "n:", "\\dcs-hermes\Network Filesystem"
WScript.Echo "You are now connected to the network printers and Drives"
Any help would be appreciated.