# Add printer bat file. error



## Kenneth G (Oct 24, 2011)

Hello. im having some problems with my manual add printer bat file. and i cant see why its not working. maby you guys could help?

its a batch file that 
1: goes on a server "ips-dc" copys the driver data and .vbs scripts to the C:\ drive. 
2: deletes a printer named "HP Laserjet M1536DNF" if its existing.
3: here is my error is comming. trys to add the ip adress of the printer and port. 
4: sets the name of the printer.
5: deletes the created C:\ created folders.

Here is the batch file i made. 

@ECHO OFF

md C:\DRIVERS
md C:\SCRIPTS

xcopy "\\ips-dc\IT\Printer Drivers\HP M1536DNF\Win7 64bit PCL5" C:\DRIVERS /I /y /D

@pause

xcopy "\\ips-dc\IT\Printer Drivers\Printer Scripts" C:\Scripts /I /Y /D

cscript.exe "C:\Scripts\Prnmngr.vbs" -d -p "HP Laserjet M1536DNF"

@pause

Cscript.exe "C:\Scripts\Prnport.vbs" -a -r HP 192.9.200.27 -h 192.9.200.27 -o raw -n 9100

@pause

REM Cscript "C:\Scripts\Prndrvr.vbs" -a -m "HP Universal Printing PCL 5" -i C:\DRIVERS\hpcu130t.inf -h c:\drivers

@pause

Cscript.exe "C:\Scripts\Prnmngr.vbs" -a -p "HP Laserjet M1536DNF" -m "HP LASERJET PRO M1536DNF PCL5" -r 192.9.200.27

rd C:\SCRIPTS /s /q
rd C:\DRIVERS /s /q

REM I add the pause in just in case it errors, I will be able to see what it is
@pause

Error code. Printer could not be added. error code.

Win32-errorcode 1797


----------

