mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Mon Oct 09, 2006 9:40 pm Post subject: Automatically redame all files to sequential numbers |
|
|
Here is a vbs script that will rename all the files to numbers. Just copy this code below into a blank text file and name is something like rename.vbs
Code: |
If Wscript.Arguments.count <= 0 Then
Wscript.echo "Please provide a folderpath as the first argument."
Wscript.Quit 1
end if
Trim(Wscript.arguments.item(0))
set fs = CreateObject("Scripting.FileSystemObject")
folder_name = Trim(Wscript.arguments.item(0))
set objFolder = fs.GetFolder(folder_name)
upperlimit = 999999.0
lowerlimit = 0.0
For Each objFile In objFolder.Files
newfilename = fs.GetFileName(objFile.path)
do
newfilename = (Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit)) & right(newfilename, len(newfilename) - instrrev(newfilename, ".")+1)
Loop Until not fs.fileexists(folder_name & "\" & newfilename)
fs.movefile objFile.path, folder_name & "\" & newfilename
next
Wscript.echo "Done" |
Now just drag and drop the folder with all the images in it onto this vbs file and it should rename them for you. |
|