Rob van der Woude's Scripting Pages
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.  

page last modified: 2024-04-16; loaded in 0.0072 seconds