Answer the question
In order to leave comments, you need to log in
Why is there a syntax error in the command?
The essence of the following is given a bunch of folders with the same exe inside (I took txt for the test) and you need to run them all
. I do the following
chcp 1251
for %%a in ('dir /A:D /b') do
Start notepad.exe 'C :\\Folder\' + %%a + '\test.txt'
Answer the question
In order to leave comments, you need to log in
Write the start command right after do.
Or you can wrap start in parentheses. The opening parenthesis must come after do on the same line.
Those. for together with the body of the loop is one cmd command and must be on the same line. Parentheses allow you to get around this limitation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question