Batch process files in Windows

From Finninday
Revision as of 21:08, 27 October 2009 by Rday (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This has been tested in XP and Vista.

Something like a shell script is available in Windows for renaming all the files in a directory:

for /F %x in ('dir /b') do move %x %x.new

That command will put a .new extension on each of the files in the current directory.

The following command will undo that transformation:

for /F %x in ('dir /b') do move %x %~nx

For more information see "for /help".