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.

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 "HP Color LaserJet MFP M577 PCL.6" -i C:\WINDOWS\system32\spool\DRIVERS\W32X86\HP_MFP_M577\hpcuXP0c.inf -h C:\WINDOWS\system32\spool\DRIVERS\W32X86\HP_MFP_M577\

Cscript "C:\Windows\System32\Prnmngr.vbs" -a -p "HP LaserJet MFP M577 Printer" -m "HP Color LaserJet MFP M577 PCL.6" -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.