Skip to content

Instantly share code, notes, and snippets.

@xcloudx01
Last active May 13, 2019 10:20
Show Gist options
  • Save xcloudx01/51e258bdddc2816699d0a42956a2ee3f to your computer and use it in GitHub Desktop.
Save xcloudx01/51e258bdddc2816699d0a42956a2ee3f to your computer and use it in GitHub Desktop.
Change file extension of all files to the one specified
;Used to change ALL files in a folder to become a specified extension and to a new name followed by an incrementing number.
;It's been handy to use sometimes when software hasn't outputted a series of files correctly but manually renaming them would fix them.
;What name shall we give the new files?
NewName = picture
;What should their extention be?
Extention = .png
;Warning that this isnt an undoable action.
msgbox,4,Warning,This will rename and change ALL files to %Extention% in the current folder`nThis is not undo-able.`n`nDo you want to continue?
ifmsgbox,no
exitapp
;Used by the below loop to determine the picture number.
number = 00
Loop * ;Run command on every single file on this folder.
{
if A_LoopFileExt != ahk ;But don't run it on .ahk files
{
number++
Var := SubStr("00" . number, -2)
FileMove,%A_LoopFileName%,%NewName%%var%%Extention%
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment