Computing.Net > Forums > Programming > batchfile help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batchfile help

Reply to Message Icon

Name: matt.scott
Date: May 22, 2009 at 14:29:32 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Hi I am trying to write a batch file to delete old printers and drivers and add the new printers.

It all seems to be working fine except one thing.
Not all of the computers will have the universal print driver. So the ones that don't have it generates an error which pops up on the screen. I would like this to be seamless to the user, so if they don't have the driver instead of creating and error and generating a pop up I would like it to just skip it and go to installing the new printers.

Any help would be greatly appreciated.


REM Delete printers

rundll32 printui.dll,PrintUIEntry /dn /n\\PGDC01\PGPR01
rundll32 printui.dll,PrintUIEntry /dn /n\\PGDC01\PGPR02
rundll32 printui.dll,PrintUIEntry /dn /n\\PGDC01\PGPR03


REM Remove Printer Drivers for Plotter, 9500 & accounting

RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /c\\%computername% /m "HP LaserJet P2015 Series PCL 5e" /h "Intel" /v "Windows 2000"
RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /c\\%computername% /m "HP Color LaserJet 9500 mfp PCL 6" /h "Intel" /v "Windows 2000"
RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /c\\%computername% /m "HP Designjet T1100 44in HPGL2" /h "Intel" /v "Windows 2000"
RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /c\\%computername% /m "HP Universal Printing PCL6" /h "Intel" /v "Windows 2000"

REM Add printers Plotter, 9500 & Accounting

rundll32 printui.dll,PrintUIEntry /in /n\\PGDC01\HP9500
rundll32 printui.dll,PrintUIEntry /in /n\\PGDC01\Accounting
rundll32 printui.dll,PrintUIEntry /in /n\\PGDC01\Plotter



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batchfile help

Batchfile Help www.computing.net/answers/programming/batchfile-help/9695.html

Help fix PING batch file www.computing.net/answers/programming/help-fix-ping-batch-file/19510.html

Batch: Help www.computing.net/answers/programming/batch-help/19864.html