:: Printer-name example: DKTASA06 set PRINTER-NAME=DKTAMA01 :: Printer-model example: HP Color LaserJet 4730mfp PCL 6 (Found inside the .inf driver file) set PRINTER-MODEL=HP Color LaserJet CP4005 PCL 6 :: Printer-ip example: 192.168.195.7 set PRINTER-IP=192.168.195.168 :: Remote-box example: DKPC123123123 set REMOTE-BOX=DKPC1106281327 :: Driver-file example: \\192.168.223.50\open\Local\Printere\Hp - Color Laserjet 4730mfp Pcl 6\hpc4730c.inf set DRIVER-FILE=\\192.168.223.50\open\Local\Printere\HP_CLJ_CP4005_64bit_XP_S2003_PCL6_HPDIU\Driver\hpc4005u.inf :: Driver-arch example: Windows NT x86 set DRIVER-ARCH=Windows x64 :: Deletes previously installed printer of the specified name cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -s %REMOTE-BOX% -p "%PRINTER-NAME%" :: Deletes previously installed printer of the specified name cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -s %REMOTE-BOX% -p "P-DKTAMA01" :: Deletes static port of previous printer, in case of mis-configuration cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prnport.vbs" -d -s %REMOTE-BOX% -r IP_%PRINTER-IP% :: Creates TCP/IP port with specified IP address cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prnport.vbs" -a -s %REMOTE-BOX% -r IP_%PRINTER-IP% -h %PRINTER-IP% -o raw -n 9100 ::Install printer driver to computer from specified location. cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -s %REMOTE-BOX% -m "%PRINTER-MODEL%" -v 3 -e "%DRIVER-ARCH%" -h "c:\printdrv" -i "%DRIVER-FILE%" :: Install the printer, using the print driver specified prior. cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -a -s %REMOTE-BOX% -p "%PRINTER-NAME%" -m "%PRINTER-MODEL%" -r IP_%PRINTER-IP% pause