Vbscript Install Network Printer Driver
I've noticed that most printer install scripts just map to shared printers on the network. This script creates an IP Port, installs the driver from an INF file and installs the printer. You'll need to supply the proper values for your printer. This utilizes windows built-in vbs printer routines. I have created a batch for each of my printers so that my users can launch them from our Intranet to install the printers that they need. These scripts are available on Win XP but can be copied to the appropriate path for Win 7. CLS @ ECHO off SET varIP = 192.
200 SET varDriver =HP Color LaserJet CP 2020 Series PCL 6 SET varDriverFolder = Server Software Hardware Drivers Printers HP CP 2025DN SET varDriverFile = Server Software Hardware Drivers Printers HP CP 2025DN hppcp 610.inf SET varName =Reception SET varLocation =Reception REM 'Deleting TCP/IP port' REM CSCRIPT /nologo%windir% system32 prnport.vbs -d -r IP_%varIP% REM 'Creating TCP/IP port' CSCRIPT /nologo%windir% system 32 prnport.vbs -a -r IP_%varIP% -o raw -n 9100 -h%varIP% CLS REM 'Installation message' @ ECHO. @ ECHO The%varLocation% printer is currently being installed. @ ECHO Please do not close this window.
@ ECHO Once the installation is complete this Setup window will exit. REM 'Driver installation' CSCRIPT /nologo%windir% system 32 prndrvr.vbs -a -m '%varDriver%' -h '%varDriverFolder%' -i '%varDriverFile%' CLS REM 'Printer deletion' @ ECHO. @ ECHO Completing installation. CSCRIPT /nologo%windir% system 32 prnmngr. Php Tools For Visual Studio License Key. vbs -d -p '%varName%' CLS REM 'Printer installation' @ ECHO. @ ECHO Completing installation. CSCRIPT /nologo%windir% system 32 prnmngr.vbs -a -p '%varName%' -m '%varDriver%' -r 'IP_%varIP%' CLS REM 'Location configuration' @ ECHO.
@ ECHO Completing installation. CSCRIPT /nologo%windir% system 32 prncnfg.vbs -t -p '%varName%' -l '%varLocation%' CLS REM 'Making it Default printer' REM CSCRIPT%windir% system32 prnmngr.vbs -p '%varName%' -t.
Jan 11, 2010 Simple printer driver install by VBScript. Scripting >Brendon Burchard Total Product Blueprint Pdf Printer. The Official Scripting Guys Forum!
Folks, Sorry I haven't contributed in a while, but I'm answering my own question here (from a post weeks ago), and I think others might find this useful. Adding a TCP/IP printer requires that you have the TCP/IP Port in place first. But there's no easy way to do that via script (that I have found, and I've looked hard). So the easiest way I have found is to set up the ports on your master PC first, then export the following registry branch: HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet Control Print Monitors Standard TCP/IP Port Ports This registry branch contains all the details about your TCP/IP ports, so capture the entire branch and save it as a registry file. Then, during your post-install script, add this: start /high /wait REGEDIT /S printers.reg (name the reg file whatever you like). Then, after the PC reboots (yes this is necessary), it will be ready to programmatically add network printers and attach them to your newly added TCP/IP ports. Telecharger Pilote Imprimante Epson Stylus C84.
I am using a CMD file with the PrintUI command structure, which I'll explain in a moment. Here is an example file adding two printers. @echo off ECHO. ECHO Installing Network Printers. ECHO Printer 1 - Canon ImageRUNNER C3200 Color Copier start /high /wait rundll32 printui.dll,PrintUIEntry /if /b 'ATL - Canon ImageRUNNER C3200' /f c: Drivers Printers C3200 P52KUSAL.inf /r 'IP_192.168.10.32' /m 'Canon iR C3200-C1 PCL5c' comment 'Copy Room' ECHO. @alhaddar, Well, just put the pieces in the right places. What is the IP address you have assigned the printer?
Where is the INF file? What is the exact name of the printer in the INF file? And finally, what do you want to call it? First, set up the IP port on a PC (any PC) that has a connection to the printer, and do a manual install of the printer driver. Note the exact name of the model in the INF file - let's say it's 'HP LaserJet 2100 PCL6'. Tema Jam Buat Hp E72. Go into Regedit and export the key I mentioned above, AFTER you set it up manually.
That.reg file should be imported during the install process, for instance, during the post-XP installation script (I use a CMD file). After it reboots, the new PC will be ready to accept the new IP printer, and you can run a second script below. Let's say the IP address you have given the printer is 192.168.1.21.
Let's also assume that the printer driver is not in XP, but you have copied it to a folder beforehand (like during the first install script) - we'll say it's in c: Install Printers HPLJ2100 HP2100.INF. And let's say you want to call it 'Al's LaserJet 2100'. You would create a small CMD file that put the pieces in place like so. @echo off ECHO. ECHO Installing Network Printers. ECHO Al's LaserJet 2100.