Použití skriptů pro instalaci tiskáren
Stránka 1 z 1

Autor:  kotouc [ ned led 25, 2015 2:09 pm ]
Předmět příspěvku:  Použití skriptů pro instalaci tiskáren

http://community.spiceworks.com/scripts ... ing-tcp-ip


REM creating folders on the remote machine to copy the drivers and printer scripts you'll need to install the printer
REM I chose two folders to keep my drivers and scripts separate to keep it simple, you can use one folder if you REM: wish


REM Using xcopy to grab the "2kXPVista" file off of the server which contains the .inf and .dll files for the Sharp MX-M623N printer.
REM Most sharp printers have this "2kXPVista" file buried in their driver when you download it from
REM For this particular Sharp MX-M623N printer, our .inf file is "sr0ejenu.inf"
REM If you look in the .inf file for your driver you’ll see the model you need, in our case it’s "SHARP MX-M623N REM: PCL6"

xcopy "\\SERVER\DRIVER_FOLDER\Sharp\MX-M623N\BF2SP-PCL6PS-1104a-2kxpVista-WHQL\EnglishA\PCL6\2kXPVista" C:\DRIVERS /I /y /D

REM /I If destination does not exist and copying more than one file, assumes that destination must be a directory.
REM /Y Suppresses prompting to confirm that you want to overwrite an existing destination file.
REM /D if you want the file or files to be copied to a directory

REM Win7 built in printer scripts
REM cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prndrvr.vbs (adds printer drivers)
REM Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs (adds printer port)
REM Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs (ties the name, port, and driver together)

REM I have these three scripts I copy from a server which also work on XP, Vista, and Win7

xcopy "\\SERVER\FOLDER\Scripts" C:\Scripts /I /Y /D

REM The first Prnmngr.vbs is to delete the printer if you're trying to add a printer with the same name
cscript "C:\Scripts\Prnmngr.vbs" -d -p "PHS - Online"

REM Adds a printer port with name "IP_PRINTERIP" and IP address of "PRINTERIP"
Cscript "C:\Scripts\Prnport.vbs" -a -r IP_PRINTERIP -h PRINTERIP -o raw -n 9100

REM Installs the printer driver, first getting the printer model and .inf file, then -h for the path to the .dll
Cscript "C:\Scripts\Prndrvr.vbs" -a -m "SHARP MX-M623N PCL6" -i C:\DRIVERS\sr0ejenu.inf -h C:\DRIVERS

REM Finally giving the printer a name of "PHS - Online", linking the model and printer port
Cscript "C:\Scripts\Prnmngr.vbs" -a -p "PHS - Online" -m "SHARP MX-M623N PCL6" -r IP_PRINTERIP

REM Last, deleting the directories
rd C:\SCRIPTS /s /q
rd C:\DRIVERS /s /q

REM I add the pause in just in case it errors, I will be able to see what it is

Stránka 1 z 1 Všechny časy jsou v UTC + 1 hodina [ Letní čas ]
Powered by phpBB® Forum Software © phpBB Group