From 818c78864927c3efa1fd409cfe858741ec85e2ba Mon Sep 17 00:00:00 2001 From: USER Date: Sun, 21 May 2023 21:15:09 +0100 Subject: [PATCH] . --- bin/l_AdminFixPrinters | 85 ++++++++++++++++++++++++++++++++++++++++++ l_AddPrinters.bat | 1 + 2 files changed, 86 insertions(+) create mode 100644 bin/l_AdminFixPrinters diff --git a/bin/l_AdminFixPrinters b/bin/l_AdminFixPrinters new file mode 100644 index 0000000..a172661 --- /dev/null +++ b/bin/l_AdminFixPrinters @@ -0,0 +1,85 @@ +@echo off +call C:\Scripts\wLocal\localENV.bat +@REM xxxxxxx +echo "START: %~n0" + +set PRINTERPS="%LOCAL%\PS\pAddPrinters.ps1" +set BROTHERPS="%LOCAL%\PS\pAddNetBrother.ps1" +set ZEBRAPS="%LOCAL%\PS\pAddNetZebra.ps1" +set EXE="Powershell.exe" + +@REM set variables to ensure they are set, +@REM printer 0 - no install +@REM printer 1 - install brother +@REM printer 2 - install zebra +@REM printer 3 - install both + +set ZUPER=0 +set PRINTER=0 + +if "%USERNAME%" == "zuper" ( + echo "Found user %USERNAME%" + echo "Not setting up printer for %USERNAME%" + set ZUPER=1 + ) + +if "%check_computername%" EQU "SURGERY1" ( + set PRINTER=3 +) + +if "%check_computername%" EQU "SURGERY2" ( + set PRINTER=3 +) + +if "%check_computername%" EQU "SURGERY3" ( + set PRINTER=3 +) + +if "%check_computername%" EQU "SURGERY4" ( + set PRINTER=3 +) + +if "%check_computername%" EQU "RECEPTION1" ( + set PRINTER=1 +) + +if "%check_computername%" EQU "RECEPTION2" ( + set PRINTER=2 +) + +if "%check_computername%" EQU "RECEPTION3" ( + set PRINTER=1 +) + +if "%check_computername%" EQU "RECEPTION4" ( + set PRINTER=1 +) + +if [%ZUPER%] == [1] ( + echo "Not installing printers" +) else ( + + cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "Fax" + cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "Microsoft XPS Document Writer" + cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "OneNote (Desktop)" + ) + +echo "FINISHED: %~n0" + +@REM https://woshub.com/manage-printers-and-drivers-from-the-command-line-in-windows-8/ +@REM https://ss64.com/nt/net-use.html +@REM https://www.windowscentral.com/how-properly-remove-printer-windows-10#uninstall_printer_printmanagement + + + + +@REM Printer name \\192.168.1.21\ZDesigner GK420d +@REM Share name ZEBRA +@REM Driver name ZDesigner GK420d + +@REM C:\Windows\System>cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.21\ZDesigner GK420d" + + +@REM Printer name \\192.168.1.22\BROTHER +@REM Share name BROTHER +@REM Driver name Brother DCP-L2510D series diff --git a/l_AddPrinters.bat b/l_AddPrinters.bat index 2011670..2958d91 100644 --- a/l_AddPrinters.bat +++ b/l_AddPrinters.bat @@ -94,6 +94,7 @@ if [%ZUPER%] == [1] ( ) cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "Fax" cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "Microsoft XPS Document Writer" + cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "OneNote (Desktop)" ) echo "FINISHED: %~n0"