I\'m trying to rename all the files inside a folder (all .exe files). I want to replace all the spaces with underscores, e.g. qwe qwe qwe asd.exe to qwe_q
qwe qwe qwe asd.exe
qwe_q
Using forfiles:
forfiles /m *.exe /C "cmd /e:on /v:on /c set \"Phile=@file\" & if @ISDIR==FALSE ren @file !Phile: =_!"
Add /s after forfiles to recurse through subfolders.
/s
forfiles