How to replace all spaces by underscores in all file names of a folder?

后端 未结 8 2297
鱼传尺愫
鱼传尺愫 2020-12-07 18:50

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

8条回答
  •  执念已碎
    2020-12-07 19:29

    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.

提交回复
热议问题