View Full Version : renaming all files in a folder (WXP-Home)
rhboarder
03-15-2006, 11:46 AM
I'm trying to figure out a way to rename all the files in a folder to the actual folder name with a number on the end. example: c:\pictures\ (is the folder) and i want to rename all the files in it to pictures1 (2,3,etc) and then delete the old files. I've looked at so many tutorials and can't find anything to help.
homeflash
03-15-2006, 05:56 PM
Have u tried dos command?
*** Sometimes Helping is a way of Learning! ***
I doubt you can use a DOS command to rename a bunch of randomly named files to: folder1, folder2, folder3, etc.
homeflash
03-15-2006, 07:15 PM
If he wants to rename in a way that will keep adding a number, i think dos command can do it, but it may need some sort script to add the random number at the end.....
*** Sometimes Helping is a way of Learning! ***
jdharm
03-15-2006, 11:56 PM
Try <a target="_blank" href=http://www.cpuaid.com/~jdharm/winguides/rename.vbs>THIS FILE</a>
The code is all kinds of ugly, but I think it works.
First try it out on copies of files you don't mind loosing to make sure it works for you. I had a couple of incidents in development that resulted in the files disappearing. I'm pretty sure I got the bugs worked out, but better safe than sorry.
Before running it you need to open it up and replace the phrase FOLDER_PATH on lines 64 and 109 with the path of the folder you want to rename. The path should end with a \ on line 109 as shown, but should not on line 64.
Josh
<a target="_blank" href=http://www.jdharm.com>www.jdharm.com</a>
rhboarder
03-16-2006, 01:08 PM
I tried it out it works pretty well. I appreciate your help with that, thank you.
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.