rdabate
asked on
Help! Can I map to a network printer using the Netlogon.bat??
Hi,
I need users to have there network printers when they move from one pc to another. They are on a 2003 domain all xp workstations. Can I have this done with the netlogon.bat?
Rick
I need users to have there network printers when they move from one pc to another. They are on a 2003 domain all xp workstations. Can I have this done with the netlogon.bat?
Rick
If a script is the way you want to do it, you could save the vbs script in the netlogon folder (i.e. addprinters.vbs), then call the VBS from the netlogon.bat by putting the following line in the netlogon.bat:
\\domaincontrollername\net logon\addp rinters.vb s
For the record, make sure you call the AddWindowsPrinterConnectio n method after EACH printer connect string declaration. So your vbs script would actually look like this:
'addprinters.vbs - connect common network printers
Set objWSHNetwork = CreateObject("WScript.Netw ork") 'create network object
strConnectString = "\\jc01\Cheshire - HP LaserJet 4000"
strResult = objWSHNetwork.AddWindowsPr interConne ction(strC onnectStri ng)
strConnectString = "\\Jc01\Cheshire - Toshiba eStudio 160"
strResult = objWSHNetwork.AddWindowsPr interConne ction(strC onnectStri ng)
strConnectString = "\\JC01\Cheshire-Brother MFC-420CN"
strResult = objWSHNetwork.AddWindowsPr interConne ction(strC onnectStri ng)
Set objWSHNetwork = Nothing
And your batch file would have this line:
\\domaincontrollername\net logon\addp rinters.vb s
Where you supply, obviously, the correct domain controller and full path to where you placed the VBS script.
Hope this helps.
\\domaincontrollername\net
For the record, make sure you call the AddWindowsPrinterConnectio
'addprinters.vbs - connect common network printers
Set objWSHNetwork = CreateObject("WScript.Netw
strConnectString = "\\jc01\Cheshire - HP LaserJet 4000"
strResult = objWSHNetwork.AddWindowsPr
strConnectString = "\\Jc01\Cheshire - Toshiba eStudio 160"
strResult = objWSHNetwork.AddWindowsPr
strConnectString = "\\JC01\Cheshire-Brother MFC-420CN"
strResult = objWSHNetwork.AddWindowsPr
Set objWSHNetwork = Nothing
And your batch file would have this line:
\\domaincontrollername\net
Where you supply, obviously, the correct domain controller and full path to where you placed the VBS script.
Hope this helps.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Set objWSHNetwork = CreateObject("WScript.Netw
strConnectString = "\\jc01\Cheshire - HP LaserJet 4000"
strConnectString = "\\Jc01\Cheshire - Toshiba eStudio 160"
strConnectString = "\\\\JC01\Cheshire-Brother
strResult = objWSHNetwork.AddWindowsPr
I've never done this before, only used the standard netlogon.bat to map drives. Can anyone help