Link to home
Start Free TrialLog in
Avatar of mperez1216
mperez1216

asked on

Using VB Script to install network printer on win9x clients

I have this script that I located on web that will install a network printer on a Win2K or XP machine and make it the default printer.

Script contents:

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\server_name\printer_share_name"
PrinterDriver = "Full_Printer_Name"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "server_name\printer_share_name"

End of script

However, the script will not run correctly on Win9x clients. Can anyone explain why and offer a resolution?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Anthony_E
Anthony_E

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mperez1216
mperez1216

ASKER

Will the script on a legacy Win 95 system also?
Thank you Anthony_E. Just using the the 3 lines resolved the issue. I also believe that I do not use the SetDefaultPrinter statement, this will only install the printer and leave the currently installed default printer alone.

For example, the user has a local Epson printer as default. I run the script to install the network printer. Now the user has the local Epson still as the default, but now also has the Xerox300 available.

Is this correct?
yeah thats correct, i had trouble using that SetDefaultPrinter statement on my win9x machine also, but the 2000 and XP machines it worked maybe something with windows 98...
thank you again.