Friday, August 21, 2009

Set the default printer from the registry

rem Using reg.exe you can set the default printer

@echo off

rem Here we are doing a split of the hostname on the hypen, so room1-01, becomes room1

for /F "tokens=1 delims=-" %%a in ('hostname') do set name=%%a


if %name% == room1 ( reg add "hkcu\software\microsoft\windows nt\currentversion\windows" /t REG_SZ /d "ROOM1PRINTER,winspool,NE04:" /v "Device" /f
)

No comments:

Post a Comment