Walk a directory/Recursively: Difference between revisions

Content added Content deleted
m (batch file migration)
m (reordering after lang rename)
Line 83: Line 83:
out .= A_LoopFileName "`n"
out .= A_LoopFileName "`n"
MsgBox,% out</lang>
MsgBox,% out</lang>

=={{header|Batch File}}==
<lang dos>dir /a-d %1</lang>

If you wanted to apply some command to each item in a directory tree, then use <code>/R</code> on a <code>FOR</code>. For example, apply the ECHO command to every DLL file in C:\Windows\System32:

<lang dos>FOR /R C:\Windows\System32 %F IN (*.DLL) DO ECHO "%F"</lang>


=={{header|C}}==
=={{header|C}}==
Line 234: Line 241:
listdir(path, &matchNPrint) ;
listdir(path, &matchNPrint) ;
}</lang>
}</lang>

=={{header|Batch File}}==
<lang dos>dir /a-d %1</lang>

If you wanted to apply some command to each item in a directory tree, then use <code>/R</code> on a <code>FOR</code>. For example, apply the ECHO command to every DLL file in C:\Windows\System32:

<lang dos>FOR /R C:\Windows\System32 %F IN (*.DLL) DO ECHO "%F"</lang>


=={{header|E}}==
=={{header|E}}==