I found nice script example on the archived forum https://autohotkey.com/board/topic/7671 ... ing-files/.
Code: Select all
debug := true ; change this to false to have it actually rename the files..
#IfWinActive, ahk_class ExploreWClass
#IfWinActive, ahk_class CabinetWClass
f1:: ; remove first 12 chars from beginning of filenames
SendInput, ^c
Loop, Parse, clipboard, `n, `r
Loop, % A_LoopField
FileMove( A_LoopFileFullPath, SubStr( A_LoopFileName, 12) )
return
f2:: ; add timestamp to beginning of filenames
FormatTime, dateStamp, YYYYMMDDHH24MISS, yyyy-MM-dd_
SendInput, ^c
Loop, Parse, clipboard, `n, `r
Loop, % A_LoopField
FileMove( A_LoopFileFullPath, dateStamp A_LoopFileName )
return
#IfWinActive
FileMove(fileFullPath, newFileName){
global debug
If debug
Msgbox, Renaming: `n%fileFullPath%`n`nTo:`n%newFileName%
Else
FileMove, %fileFullPath%, %newFileName%
}