René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

FOR loop in the dos box

for %V in

Print all files ending in .html in the current directory:
for %i in (*.html) do @echo %i

~n

The following for loop renames all files with the suffix foo in files with the suffix bar.
This works with the ~n idiom that is a file's name without suffix.
for %i in (*.foo) do move %i %~ni.bar

for /f %V in (command)

Assign the current time to %t and echo %t:
for /f %t in ('time /t') do @echo it's %t, now
Recursively print all *html files:
for /f %h in ('dir /s /b *.html') do @echo %h