Printer Driver from batch file help

Scottland89

New Member
Joined
Sep 23, 2014
Messages
16
Hi,
Firstly apologies if this isn't the right place to post this.

I'm needing help with a batch file I'm trying to create. The batch file is to be used to install a printer driver for a HP Color LaserJet MFP M577 printer onto Windows XP based machines. I've reused code from a different printer driver batch file installer created by an ex-colleague which I know works. Despite making what I believe are the necessary changes (see below code, changes are in bold), it it's coming up with 2 errors around this part of the code.

Code:
Cscript "C:\Windows\System32\Prnport.vbs" -a -r IP_%IP_Addr% -h %IP_Addr% -o raw -n 9100

Cscript "C:\Windows\System32\Prndrvr.vbs" -a -m "[B]HP Color LaserJet MFP M577 PCL.6[/B]" -i [B]C:\WINDOWS\system32\spool\DRIVERS\W32X86\HP_MFP_M577\hpcuXP0c.inf[/B] -h [B]C:\WINDOWS\system32\spool\DRIVERS\W32X86\HP_MFP_M577\[/B]

Cscript "C:\Windows\System32\Prnmngr.vbs" -a -p "[B]HP LaserJet MFP M577 Printer[/B]" -m "[B]HP Color LaserJet MFP M577 PCL.6[/B]" -r IP_%IP_Addr%

I put that batch file and all the driver files into an .exe file (via winrar, which extracts all to the path mentioned in the code, which I have confirmed). However when the batch script runs after the .exe does the extraction, the middle Cscript (the one for the printer driver) gives a Win32 Error 123 (googling it shows that means The filename, directory name, or volume label syntax is incorrect).

I've copied and pasted the path in the code into the SFX options for the .exe and vice versa and I know it's all the same so know the paths are correct (as well as checking the path). I can manually install the drivers using the files that is left behind by the .exe but the batch itself won't set up the printers.

The Cscript for Prnmngr also gives a Win32 Error 1797 which is for unknown printer driver, but I'm guessing that is because of the above error, and if I solve one, I solve both.

Can somebody shine light on why this won't work?

Thanks for your time.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,812
Messages
6,121,702
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top