.
This commit is contained in:
80
archive/l_AddPrinters.bat
Normal file
80
archive/l_AddPrinters.bat
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
@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 (
|
||||||
|
if [%PRINTER%] == [1] (
|
||||||
|
echo "Installing Brother"
|
||||||
|
%EXE% -ExecutionPolicy Bypass -File %BROTHERPS%
|
||||||
|
)
|
||||||
|
if [%PRINTER%] == [2] (
|
||||||
|
echo "Installing Zebra"
|
||||||
|
%EXE% -ExecutionPolicy Bypass -File %ZEBRAPS%
|
||||||
|
)
|
||||||
|
if [%PRINTER%] == [3] (
|
||||||
|
echo "Installing Brother and Zebra"
|
||||||
|
%EXE% -ExecutionPolicy Bypass -File %BROTHERPS%
|
||||||
|
%EXE% -ExecutionPolicy Bypass -File %ZEBRAPS%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
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
|
||||||
@ -60,11 +60,22 @@ if [%ZUPER%] == [1] (
|
|||||||
) else (
|
) else (
|
||||||
if [%PRINTER%] == [1] (
|
if [%PRINTER%] == [1] (
|
||||||
echo "Installing Brother"
|
echo "Installing Brother"
|
||||||
%EXE% -ExecutionPolicy Bypass -File %BROTHERPS%
|
@REM %EXE% -ExecutionPolicy Bypass -File %BROTHERPS%
|
||||||
|
@REM rundll32 printui.dll,PrintUIEntry /in /n \\192.168.1.22\brother
|
||||||
|
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.22\BROTHER"
|
||||||
|
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.22\BROTHER"
|
||||||
|
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -ac -p "\\192.168.1.22\BROTHER"
|
||||||
|
@REM rundll32 printui.dll,PrintUIEntry /y /n \\server_name\printer_name
|
||||||
)
|
)
|
||||||
if [%PRINTER%] == [2] (
|
if [%PRINTER%] == [2] (
|
||||||
echo "Installing Zebra"
|
echo "Installing Zebra"
|
||||||
%EXE% -ExecutionPolicy Bypass -File %ZEBRAPS%
|
@REM %EXE% -ExecutionPolicy Bypass -File %ZEBRAPS%
|
||||||
|
CD C:\WINDOWS\SYSTEM
|
||||||
|
@REM rundll32 printui.dll,PrintUIEntry /in /n \\192.168.1.21\zebra
|
||||||
|
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.21\ZEBRA"
|
||||||
|
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.21\ZDesigner GK420d"
|
||||||
|
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -ac -p "\\192.168.1.21\ZEBRA"
|
||||||
|
@REM rundll32 printui.dll,PrintUIEntry /y /n \\server_name\printer_name
|
||||||
)
|
)
|
||||||
if [%PRINTER%] == [3] (
|
if [%PRINTER%] == [3] (
|
||||||
echo "Installing Brother and Zebra"
|
echo "Installing Brother and Zebra"
|
||||||
@ -77,4 +88,18 @@ echo "FINISHED: %~n0"
|
|||||||
|
|
||||||
@REM https://woshub.com/manage-printers-and-drivers-from-the-command-line-in-windows-8/
|
@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://ss64.com/nt/net-use.html
|
||||||
@REM https://www.windowscentral.com/how-properly-remove-printer-windows-10#uninstall_printer_printmanagement
|
@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
|
||||||
|
|||||||
150
test.bat
150
test.bat
@ -1,150 +0,0 @@
|
|||||||
@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 (
|
|
||||||
if [%PRINTER%] == [1] (
|
|
||||||
echo "Installing Brother"
|
|
||||||
@REM %EXE% -ExecutionPolicy Bypass -File %BROTHERPS%
|
|
||||||
@REM rundll32 printui.dll,PrintUIEntry /in /n \\192.168.1.22\brother
|
|
||||||
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.22\brother"
|
|
||||||
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.22\brother"
|
|
||||||
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -ac -p "\\192.168.1.22\brother"
|
|
||||||
@REM rundll32 printui.dll,PrintUIEntry /y /n \\server_name\printer_name
|
|
||||||
)
|
|
||||||
if [%PRINTER%] == [2] (
|
|
||||||
echo "Installing Zebra"
|
|
||||||
@REM %EXE% -ExecutionPolicy Bypass -File %ZEBRAPS%
|
|
||||||
CD C:\WINDOWS\SYSTEM
|
|
||||||
@REM rundll32 printui.dll,PrintUIEntry /in /n \\192.168.1.21\zebra
|
|
||||||
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.21\ZEBRA"
|
|
||||||
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.21\ZDesigner GK420d"
|
|
||||||
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -ac -p "\\192.168.1.21\ZEBRA"
|
|
||||||
@REM rundll32 printui.dll,PrintUIEntry /y /n \\server_name\printer_name
|
|
||||||
)
|
|
||||||
if [%PRINTER%] == [3] (
|
|
||||||
echo "Installing Brother and Zebra"
|
|
||||||
%EXE% -ExecutionPolicy Bypass -File %BROTHERPS%
|
|
||||||
%EXE% -ExecutionPolicy Bypass -File %ZEBRAPS%
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
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 Server name
|
|
||||||
@REM Printer name \\192.168.1.21\ZDesigner GK420d
|
|
||||||
@REM Share name ZEBRA
|
|
||||||
@REM Driver name ZDesigner GK420d
|
|
||||||
@REM Port name USB001
|
|
||||||
@REM Comment
|
|
||||||
@REM Location
|
|
||||||
@REM Print processor winprint
|
|
||||||
@REM Data type RAW
|
|
||||||
@REM Parameters
|
|
||||||
@REM Attributes 2584
|
|
||||||
@REM Priority 1
|
|
||||||
@REM Default priority 0
|
|
||||||
@REM Average pages per minute 0
|
|
||||||
@REM Printer status Idle
|
|
||||||
@REM Extended printer status Unknown
|
|
||||||
@REM Detected error state Unknown
|
|
||||||
@REM Extended detected error state Unknown
|
|
||||||
|
|
||||||
@REM Number of local printers and connections enumerated 6
|
|
||||||
|
|
||||||
@REM C:\Windows\System>cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -p "\\192.168.1.21\ZDesigner GK420d"
|
|
||||||
@REM Microsoft (R) Windows Script Host Version 5.812
|
|
||||||
@REM Copyright (C) Microsoft Corporation. All rights reserved.
|
|
||||||
|
|
||||||
@REM Deleted printer \\192.168.1.21\ZDesigner GK420d
|
|
||||||
|
|
||||||
@REM C:\Windows\System>
|
|
||||||
|
|
||||||
|
|
||||||
@REM Server name
|
|
||||||
@REM Printer name \\192.168.1.22\BROTHER
|
|
||||||
@REM Share name BROTHER
|
|
||||||
@REM Driver name Brother DCP-L2510D series
|
|
||||||
@REM Port name USB001
|
|
||||||
@REM Comment
|
|
||||||
@REM Location
|
|
||||||
@REM Print processor winprint
|
|
||||||
@REM Data type RAW
|
|
||||||
@REM Parameters
|
|
||||||
@REM Attributes 540
|
|
||||||
@REM Priority 1
|
|
||||||
@REM Default priority 0
|
|
||||||
@REM Average pages per minute 0
|
|
||||||
@REM Printer status Printing
|
|
||||||
@REM Extended printer status Unknown
|
|
||||||
@REM Detected error state Other
|
|
||||||
@REM Extended detected error state Unknown
|
|
||||||
|
|
||||||
@REM Number of local printers and connections enumerated 6
|
|
||||||
|
|
||||||
@REM C:\Users\front1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user