@echo off echo LPR Printer Script for HPLJ2200d set station=%COMPUTERNAME% set room=%station:~0,-2%01 set numb=%station:~-2,2% rem echo %station% rem echo %room% rem echo %numb% if "%1" == "01" goto renamelocal if "%1" == "" goto nextpart set room=%1 goto nextpart2 :nextpart if "%numb%" == "01" goto renamelocal :nextpart2 if "%room%" == "" goto WRONG echo Create %room%.reg echo REGEDIT4 >c:\temp\%room%.reg echo. >>c:\temp\%room%.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\LPR Port\Ports\%room%:hplj2200d] >>c:\temp\%room%.reg echo "Server Name"="%room%" >>c:\temp\%room%.reg echo "Printer Name"="hplj2200d" >>c:\temp\%room%.reg echo "OldSunCompatibility"=dword:00000000 >>c:\temp\%room%.reg echo "HpUxCompatibility"=dword:00000000 >>c:\temp\%room%.reg echo "EnableBannerPage"=dword:00000000 >>c:\temp\%room%.reg echo. >>c:\temp\%room%.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\LPR Port\Ports\%room%:hplj2200d\Timeouts] >>c:\temp\%room%.reg echo "CommandTimeout"=dword:00000078 >>c:\temp\%room%.reg echo "DataTimeout"=dword:0000012c >>c:\temp\%room%.reg echo Merge %room%.reg regedit /s c:\temp\%room%.reg echo Stop TCP/IP Printer Server net stop lpdsvc echo Stop Spooler net stop spooler echo Start Spooler net start spooler echo Install %room%:hplj2200d rundll32 printui.dll,PrintUIEntry /if /b "hplj2200d" /f "c:\updates\Drivers\Printers\hplj2200d\Win2000_XP\PCL6\hpbf322i.inf" /r "%room%:hplj2200d" /m "HP LaserJet 2200 Series PCL 6" /z /q /u echo Set Default Printer RUNDLL32 PRINTUI.DLL,PrintUIEntry /n "hplj2200d" /y goto donewithit :renamelocal echo Create Registry to Set LPD to Automatic echo REGEDIT4 >c:\temp\lpd.reg echo. >>c:\temp\lpd.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LPDSVC] >>c:\temp\lpd.reg echo "Start"=dword:00000002 >>c:\temp\lpd.reg echo Merge lpd.reg regedit /s c:\temp\lpd.reg echo Stop TCP/IP Printer Server net stop lpdsvc echo Start TCP/IP Printer Server net start lpdsvc echo Rename Printer HP LaserJet 2200 RUNDLL32 PRINTUI.DLL,PrintUIEntry /dl /n "HP LaserJet 2200 Series PCL" /q rundll32 printui.dll,PrintUIEntry /if /b "hplj2200d" /f "c:\updates\Drivers\Printers\hplj2200d\Win2000_XP\PCL6\hpbf322i.inf" /r "lpt1:" /m "HP LaserJet 2200 Series PCL 6" /z /q /u echo Set Default Printer RUNDLL32 PRINTUI.DLL,PrintUIEntry /n "hplj2200d" /y goto donewithit :Wrong echo I don't know what happened :donewithit echo Remove PDF Creator RUNDLL32 PRINTUI.DLL,PrintUIEntry /dl /n "PDFCreator" /q echo "DONE"