Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Complicated DOS Commands w/ Subdirectories
Are you looking for a way to rename files in subdirectories?1) Navigate to the folder that contains the subfolders, using Windows Explorer. Copy the address line to your clipboard.
2) Open a DOS prompt. Enter "CD " and then right click (to paste)
3) Do a directory search, "DIR"
4) Highlight the folder names by holding down the left click of the mouse, positioning the cursor at the first letter of the first folder, holding the click, and then dragging to highlight all the desired folder names. Be sure to highlight the entire name of all folders with the highlighted square that's created. Press the [Enter] key to copy the highlighted contents to your clipboard.
5) Open MS Word, Press the [Enter] key once, then paste the contents of clipboard ([CTRL] + "C")
6) Do copy and replace ([CTRL] + "H"), and replace "^p" with "^pCD " ("^p" is the <carriage-return. + <line-feed.)
7) Clear the empty space at the top of the page (that was created when you pressed the [Enter] key)
8) Do copy and replace again, this time replacing "^p" with ^prename *.OldExtension *.NewExtension^p (replace "OldExtension" with desired extension name to change, and "NewExtension" with desired new name)
9) Select all ([CTRL] + "A"), and copy to clipboard ([CTRL] + "C")
10) Go back to the opend DOS prompt from earlier, and paste clipboard contents (right click), then press [Enter]WHOLA!!!! Magic, all files within subdirectories are renamed!

Very good but Windows XP has NT Command Prompt not MS-DOS, surely this should mof been posted in the Programming Forum ??

So if I understand it, your procedure changes the file extensions of all the files with the same extension in multiple directories but doesn't actually change the file name? Or am I missing something?

It can be modified to suite the needs at hand. It's just a method that I make use of to manage some situations.
It works in any Windows environment. My test platform for this post was within Windows XP.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |