Install IP-Printer via VBS/BAT script. What's broken?
I'm attempting to install a network printer on a spread of Windows XP/Vista/7 (all 32bit).
I have the printer drivers from the OEM and attached them to the script. Which then unzips them to "C:\INF"
Following the unzip, the VBS script is run which calls the .bat file silently.
Here is the VBS script:
Set WshShell = CreateObject("WScript.Shell") cmds=WshShell.RUN("c:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\163\installC654.bat", 0, True) Set WshShell = Nothing
Here's the bat file:
Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_10.2.2.30 -h 10.2.2.30 -o raw Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prndrvr.vbs -a -m "KONICA MINOLTA C754SeriesPCL" -v 3 -e "Windows NT x86" -h C:\INF -i C:\INF\Driver\Drivers\PCL\EN\Win_x86\KOAYSJ__.INF Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs -a -m "KONICA MINOLTA C754SeriesPCL" -r IP_10.2.2.30 -p "3rd Floor C654 Copier"
When I manually run the scripts, via admin rights, the printer installs flawlessly.
However, when I push the script from the KBOX, it doesn't work. No failed log messages on the KBOX, none on the client.
Any input on what isn't right?
Answers (4)
Why don't you run the batch script with 1,True
Also.. Put one "Pause" command at the end of batch file.
So that you can see what is happening actually when this script is executed..
Comments:
-
Being new to Windows scripting, what does the 1,True flag change?
Batch file runs successfully when run on the local machine as admin. - nseery 11 years ago -
objShell.Run (strCommand, [intWindowStyle], [bWaitOnReturn])
Settings for intWindowStyle:
0 Hide the window and activate another window.
1 Activate and display the window. (restore size and position) Specify this flag when displaying a window for the first time.
2 Activate & minimize.
3 Activate & maximize.
4 Restore. The active window remains active.
5 Activate & Restore.
6 Minimize & activate the next top-level window in the Z order.
7 Minimize. The active window remains active.
8 Display the window in its current state. The active window remains active.
9 Restore & Activate. Specify this flag when restoring a minimized window.
10 Sets the show-state based on the state of the program that started the application. - jagadeish 11 years ago -
When you put 1,True.. This will not hide your cmd prompt when it executing the batch file... I asked you to put "Pause" at the end of batch file to see what is happening when it is executing those command lines... If it is working in Administrator account, it does not mean that it will also work as System account.. In your case first you will have to identify what is wrong with the command lines when it is executed through System acccount - jagadeish 11 years ago
-
prnport works. No errors (this command doesn't require admin rights)
prndrvr fails with error code 5 (permissions) when pushed with Run As Domain Admin
prndrvr fails with error code -2146500030 when run as a Local System
prnmngr fails with error 0x80041003 Access Denied as Local System - nseery 11 years ago -
Are you getting any error when you run the modified script thorugh system account - jagadeish 11 years ago
-
Yes, prndrvr fails with error code -2146500030 when Run As a Local System from the KBOX. - nseery 11 years ago
-
Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prndrvr.vbs -a -m "KONICA MINOLTA C754SeriesPCL" -v 3 -e "Windows NT x86" -h C:\INF\Driver\Drivers\PCL\EN\Win_x86 -i C:\INF\Driver\Drivers\PCL\EN\Win_x86\KOAYSJ__.INF
Can you try with the above command - jagadeish 11 years ago-
-2146500030: The driver is signed, but either the signer or the certificate in the certificate chain is not the root of - jagadeish 11 years ago
-
Still erroring on prndrvr with -2146500030 - nseery 11 years ago
After attempting to install a different printer driver, to rule out this driver acting up, I've decided that something is amiss with that driver and working with it via the CLI. What's wrong, I have no clue.
Trying to install an a different driver results in some totally different, and still weird, errors, but, with enough fiddling, it sometimes works.
Thanks for your help Jagadeish.
Comments:
-
I've noticed that Konica drivers are hit and miss when it comes to scripting myself. I just tried to script silent installs using the latest 2013 drivers for a couple of models and I'm getting weird errors as well. The 2010 drivers seem fine though. All of them are signed, but who knows... - dotNettles 11 years ago