Help!!
So I have a batch file that looks at the name of a file and then prints to sumatrapdf.exe to a printer name based on the original file name. The printer name is stored in a parameter. When I echo the printer name parameter it is correct. When I pass the printer name parameter to the print program, it errors, assuming its because it cannot see the printer name parameter. (thinking I somehow need to pass across another set of "%"'s so that batch file knows its a parameter.
FOR %%F IN (%C:\Users\nick\Desktop\Test1%\Shelf*.csv) DO (
set filename=%%~nF
Set filename1=%%F
goto tests
)
:tests
echo "%filename1%"
echo "%filename%"
Set "Shelf-01Printer=NPIBBF846 (HP Color LaserJet CP2025dn)"
Set "Shelf-07Printer=NPIBBF846 (HP Color LaserJet CP2025dn)"
Set "Shelf-97Printer=NPIBBF846 (HP Color LaserJet CP2025dn)"
Set "Hook-09Printer=HP LaserJet P2050 Series PCL6"
Set "PrinterName=%filename%Printer"
Echo %PrinterName%
Start SumatraPDF.exe -print-to %PrinterName% "C:\Users\nick\Desktop\Test1\% filename%".pdf
Timeout /t 15