Created
May 29, 2014 06:20
-
-
Save dashmug/b463da29c930633333dc to your computer and use it in GitHub Desktop.
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
Const ForReading = 1, ForWriting = 2, ForAppending = 8 | |
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 | |
Dim fso, startFolder, folder, files, lines | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
startFolder = fso.GetAbsolutePathName(".") | |
Set folder = fso.GetFolder(startFolder) | |
Set files = folder.Files | |
lines = "" | |
For Each file in files | |
If InStr(file.Name,".jpg") > 0 Then | |
lines = lines & "ren " & file.Name & " " & file.Name & vbCrLf | |
End If | |
Next | |
Set batchFile = fso.OpenTextFile(startFolder & "\rename.bat", ForWriting, True) | |
batchFile.Write(lines) | |
batchFile.Close | |
MsgBox "You can now check and edit " & startFolder & "\rename.bat.", vbOKOnly, "Success." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment