Created
February 3, 2011 20:57
-
-
Save jkatricak/810178 to your computer and use it in GitHub Desktop.
Rename all files in a directory with one extention to another extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Convert .ddb files to .bdb for camera backup software | |
'Note: this script must be in the same directory | |
'(normally _DDB_) as the files you want to convert. | |
Set WshShell = WScript.CreateObject("WScript.Shell") | |
Set objFS = CreateObject("Scripting.FileSystemObject") | |
strCurrentFolder=WshShell.CurrentDirectory | |
Dim fso, f, f1, fc, s | |
Dim i | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set f = fso.GetFolder(strCurrentFolder) | |
Set fc = f.Files | |
i = 0 | |
For Each f1 in fc | |
filesplit = Split(f1.Name,".") | |
If filesplit(1) = "ddb" Then | |
fso.MoveFile f1.Name,filesplit(0) & ".bdb" | |
i = i+1 | |
End If | |
Next | |
msgbox("Done!" & vbcrlf & vbclrf & "Renamed " & i & " files.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment