Quoting Issue
Posted: 31 Jan 2020 23:10
I guess I have spent so much wasted time working in RedPoint that I completely forgot how to write a batch file.
This does not work.
If I take away the quotes from the search string then it works fine.
Even when I try to use the USEBACKQ option I still get the same results.
Can someone refresh my memory.
This does not work.
Code: Select all
W:\>FOR /F "TOKENS=2" %G IN ('"C:\Program Files\WinZIP\wzunzip.exe" -vt ABC1NFD_20200127.zip ^|findstr /E /C:"_P.txt"') DO @echo %G
'C:\Program' is not recognized as an internal or external command,operable program or batch file.
Code: Select all
W:\>FOR /F "TOKENS=2" %G IN ('"C:\Program Files\WinZIP\wzunzip.exe" -vt ABC1NFD_20200127.zip ^|findstr /E /C:_P.txt') DO @echo %G
ABC1NFD_SPS_A_20200127_P.txt
Code: Select all
W:\>FOR /F "USEBACKQ TOKENS=2" %G IN (`"C:\Program Files\WinZIP\wzunzip.exe" -vt ABC1NFD_20200127.zip ^|findstr /E /C:"_P.txt"`) DO @echo %G
'C:\Program' is not recognized as an internal or external command,operable program or batch file.
W:\>FOR /F "USEBACKQ TOKENS=2" %G IN (`"C:\Program Files\WinZIP\wzunzip.exe" -vt ABC1NFD_20200127.zip ^|findstr /E /C:_P.txt`) DO @echo %G
ABC1NFD_SPS_A_20200127_P.txt