vb script to connect network printer
Posted on 2006-05-28
We share office space with another tennant who needs to access our Network printers. They are on a workgroup, we are on a domain. I've installed another NIC in our print server (Win 2003Std) and assigned in an IP address within their segment. I can browse to the print server and need to enter domain usernam and password. After doing this I can connect each of the workstations to our printers and print OK. After rebooting the workstations I can no longer print and get the message "Print spooler not running" (even thought it is.). I need to then delete and re-add each printer.
One idea I had was to ass the printer each time usig the below vbs script, but how do I pass domain user credential in the script so user is not prompted?
('// Name: setprint.vbs
'// Description: Add a network printer and make it the default
Set WshNetwork = CreateObject("WScript.Network")
'// Adds the printer. Substitute your server name and printer share.
'// Makes the specified printer the default.