I've read probably 20 stacks and have tried to mash together an answer and it just isn't coming together. I need to loop over a set of files in a directory, running a command on them as I go, and log the output. (Ideally a text compare on the output from the command would be nice, but I'm fine to read through the log.) PROBLEM: The following command doesn't output the result to the txt file. It outputs the "dumpbin /HEADERS...." into the txt. The command itself is not being run.
for %%f in ('dir /b "\\machine\c$\Program Files (x86)\software\bin64\*"') do (dumpbin /HEADERS %%f | find "machine")
Then I'm running look.bat >>foo.txt
The above is meant to pump out either 32bit word machine or 8664 machine (x64) depending on the file when run from VS Command prompt.
I've also tried the following with no difference.
for /f "usebackq delims=|" %%f in ('dir /b "\\machine\c$\Program Files (x86)\software\bin64\*"') do (dumpbin /HEADERS %%f | find "machine")