• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Installing printers from a commandline/batch file? <batch file guru needed>

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Rutkus

Member
Joined
Jun 16, 2003
Location
Texas
Installing printers from a commandline/batch file? <batch file guru needed>

I want to create a batch file that uses the /ss and /sr flags to install multiple printers at a time, I keep getting an error that says "operation" could not complete,


On one machine, I manually install the printer, then when I'm sure that it is working I store the settings to a file "print.dat"


When I get everything configured correctly and I'm sure that it is working, I go to install on another machine, the installation is a 3 stage process,

FIRST install the ports via a regpack.

REGEDIT.EXE /S Print.reg

NEXT install the name of the printer, doesn't matter the driver attached because the stored data settings are SUPPOSED to override what is already there

RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b "Printer Name" /f %windir%\inf\ntprint.inf /r "lpt1:" /m "AGFA-AccuSet v52.3"

Next, get the printer settings from the stored DAT file and overwrite what is already there, this does not change the printer name but changes all the other settings like ports, type, driver, etc.

RUNDLL32 PRINTUI.DLL PrintUIEntry /Ss "printer name as it appears" /a "print.dat"

The Problem.

it goes through and stores them correctly but when i try to restore via: RUNDLL32 PRINTUI.DLL PrintUIEntry /Sr "printer name as it appears" /a "print.dat"

I get a "Operation could not be completed" error dialog, I don't know what i'm doing wrong, anyone?

I know that I have to copy over ports as well so on the machine which I have the printers properly configured I have copied the "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\" registry and selected the ports in a regpack to carry over to whatever machine I'm trying install these printers on. I want to create local ports that connect to the printer on the repective server i.e. \\computer\printer, maybe i'm selecting the wrong ports? I still get the "Operation could not be completed" error when it trys to reinstall the data from the stored printer settings, any input is greatly appreciated.
 
Last edited:
Back