multiple commands in DOS FOR LOOP


By: Tai NGUYEN C2P
January 30, 2009

Hello everyone,

I have just found out the way to execute multiple commands in DOS FOR LOOP. The trick is '&' between commands

Ex:
echo. > t.tmp
for /f %%a IN ('dir /b *.sql') do ( echo PROMPT %%a >> t.tmp & echo @%%a >> t.tmp)

Have fun !!!

Tai NGUYEN C2P


Need more help?
Describe your Problem
Example: Hard Drive Not Detected on My PC

Ask Question