Powered by GeSHi

Source code for defprnnt.bat

(view source code of defprnnt.bat as plain text)

  1. @ECHO OFF
  2. REGEDIT /E %TEMP%.\DEFPRINT.REG HKEY_CURRENT_USER\Printers\Settings
  3. FOR /F "TOKENS=1,2* DELIMS==" %%A IN (%TEMP%.\DEFPRINT.REG) DO CALL :Display %%A
  4. DEL %TEMP%.\DEFPRINT.REG
  5. ECHO.
  6. ECHO Default Printer: %DEFPRINT:\\=\%
  7. GOTO:EOF
  8.  
  9. :Display
  10. SET LINE=%1
  11. FOR %%A IN (%LINE:"= %) DO IF NOT %LINE%==%%A SET DEFPRINT=%%A
  12. GOTO:EOF
  13.