0

I've been having some issues with a batch script that i have setup to add IP printers as local printers. It seems to be working just find on my own computer where i wrote the script but now seem to have troubles while testing it on another computer. It looks like it goes through the script but is not adding the printer itself. I can see that the correct ports are being created but the printer is not showing up in devices and printers after the script completes running. Any insight on what might be the problem would be appreciated.

    CLS
@ECHO off

SET varIP=PRINTER_IP
SET varDriver=Dell 1355cn Color MFP XPS
SET varDriverFolder=\\server location of driver
SET varDriverFile=\\server location of file
SET varName=Color
SET varLocation=Color

REM C:\Windows\System32\Printing_Admin_Scripts\en-US  - script location

REM "Deleting TCP/IP port"
CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -d -r IP_%varIP%

REM "Creating TCP/IP port"
CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_%varIP% -o raw -n 9100 -h %varIP%

CLS
REM "Installa tion message"
@ECHO.
@ECHO The %varLocation% printer is currently being installed.
@ECHO.
@ECHO Please do not close this window.
@ECHO.
@ECHO Once the installation is complete this Setup window will exit.
@ECHO.
Pause
REM "Driver installation"
CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "%varDriver%" -h "%varDriverFolder%" -i "%varDriverFile%"  
CLS

"Printer deletion"
@ECHO.
@ECHO Completing installation.
CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -d -p "%varName%" 
CLS

REM "Printer installation"
@ECHO.
@ECHO Completing installation.
CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a -p "%varName%" -m "%varDriver%" -r "IP_%varIP%"
CLS

REM "Location configuration"
@ECHO.
@ECHO Completing installation.
CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prncnfg.vbs -t -p "%varName%" -l "%varLocation%"
CLS

REM "Making it Default printer"
CSCRIPT %windir%\system32\prnmngr.vbs -p "%varName%" -t
1
  • -1 Your first sentence makes no sense. And Your batch script does nothing much, it's the vbs files you run that do things. So it looks like not really a batch question. Maybe you din't set your variables at the top correctly or they refer to things inaccessible.
    – barlop
    Apr 17, 2014 at 16:27

2 Answers 2

0

First thing that I would do is to go to the computer that it does not work on, run each command from cmd.exe one after another and see which step does not complete its task like it should.

Once we can narrow it down to which step is having problems it might be easier to find out what is going wrong on that machine. If everything works fine when you manually run each command then I would guess that one of the variables is not setting itself correctly on the other machine.

0

Given that your script is heavily dependend on vbscripting, I would ask: is the Windows Scripting Host service installed? It is not by default installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .