?
Solved

Using VB Script to install network printer on win9x clients

Posted on 2005-03-02
5
Medium Priority
?
2,471 Views
Last Modified: 2013-12-29
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.
0
Comment
Question by:mperez1216
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
Anthony_E earned 200 total points
ID: 13445845
Well Microsoft's site says this script works, maybe just use these 3 lines which u already have in your script..
Script from here:  http://www.microsoft.com/technet/scriptcenter/scripts/printing/client/prclvb01.mspx

---------------------------
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Xerox300"
WshNetwork.SetDefaultPrinter "\\PrintServer1\Xerox300"
---------------------------
0
 

Author Comment

by:mperez1216
ID: 13489680
Will the script on a legacy Win 95 system also?
0
 

Author Comment

by:mperez1216
ID: 13717403
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?
0
 
LVL 5

Expert Comment

by:Anthony_E
ID: 13721589
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...
0
 

Author Comment

by:mperez1216
ID: 13725983
thank you again.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring Remote Assistance for use with SCCM
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question