You are not logged in.

#1 23 Dec 2019 13:34

PiotrMP006
Member
Registered: 02 Apr 2019
Posts: 12

For /f loop findstr problem The batch script finds nothing !!!

"C:\Program Files\7-Zip\7z.exe" h -scrcsha256 "Test.7z" output:

SHA256                                                                    Size  Name
---------------------------------------------------------------- -------------  ------------
1D29A48C53E20F5E854FA67A81FFAD7366DF42E507D319CC41FF21E7DE4A4DBC           106  Test.7z
---------------------------------------------------------------- -------------  ------------
1D29A48C53E20F5E854FA67A81FFAD7366DF42E507D319CC41FF21E7DE4A4DBC           106

Size: 106

SHA256 for data:              1D29A48C53E20F5E854FA67A81FFAD7366DF42E507D319CC41FF21E7DE4A4DBC

Everything is Ok


"C:\Program Files\7-Zip\7z.exe" h -scrcsha256 "Test.7z" | findstr /c:"SHA256 for data"

A command launched from the command line finds this

SHA256 for data:              1D29A48C53E20F5E854FA67A81FFAD7366DF42E507D319CC41FF21E7DE4A4DBC



for /f "skip=1 tokens=* usebackq" %%a in (`^""C:\Program Files\7-Zip\7z.exe" h -scrcsha256 "Test.7z" ^| findstr "SHA256 for data"^"`) do echo %%a

The batch script finds nothing !!!!

Please help me

Last edited by PiotrMP006 (23 Dec 2019 13:38)

Offline

#2 23 Dec 2019 20:02

mhight
New Member
Registered: 23 Dec 2019
Posts: 1

Re: For /f loop findstr problem The batch script finds nothing !!!

You shouldn't need the skip=1 option. It works for me without it.

Offline

Board footer

Powered by