Sunday, 10 April 2016 00:00

Batch file for Windows 7 to add printers and set default by seat (computername)

set script=cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs

%script% -x

if /i %COMPUTERNAME%==RED01 set default=laser2
if /i %COMPUTERNAME%==RED02 set default=laser2
if /i %COMPUTERNAME%==RED03 set default=laser2
if /i %COMPUTERNAME%==SMARTBRDRED set default=laser2

if /i %COMPUTERNAME%==RAINBOW01 set default=laser2
if /i %COMPUTERNAME%==RAINBOW02 set default=laser2
if /i %COMPUTERNAME%==RAINBOW03 set default=laser2
if /i %COMPUTERNAME%==SMARTBRDRAINBOW set default=laser2


if /i %COMPUTERNAME%==YELLOW01 set default=laser1
if /i %COMPUTERNAME%==YELLOW02 set default=laser1
if /i %COMPUTERNAME%==YELLOW03 set default=laser1
if /i %COMPUTERNAME%==SMARTBRDYELLOW set default=laser1


if /i %COMPUTERNAME%==GREEN01 set default=laser1
if /i %COMPUTERNAME%==GREEN02 set default1=laser1
if /i %COMPUTERNAME%==GREEN03 set default1=laser1
if /i %COMPUTERNAME%==SMARTBRGREEN set default=laser1


if /i %COMPUTERNAME%==ORANGE01 set default=laser1
if /i %COMPUTERNAME%==ORANGE02 set default=laser1
if /i %COMPUTERNAME%==ORANGE03 set default=laser1
if /i %COMPUTERNAME%==SMARTBRDORANGE set default=laser1


if /i %COMPUTERNAME%==BLUE01 set default=laser3
if /i %COMPUTERNAME%==BLUE02 set default=laser3
if /i %COMPUTERNAME%==BLUE03 set default=laser3
if /i %COMPUTERNAME%==SMARTBRDBLUE set default=laser3

if /i %COMPUTERNAME%==SMARTBRD701 set default=laser3
if /i %COMPUTERNAME%==SMARTBRD702 set default=laser3
if /i %COMPUTERNAME%==SMARTBRD703 set default=laser3


%script% -ac -p \\server1\laser1
%script% -ac -p \\server1\laser2
%script% -ac -p \\server1\laser3

%script% -t -p \\server1\%default%
Last modified on Sunday, 10 April 2016 21:38

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.