Tuesday, June 26, 2018

cmd: 將windows文件名的空白鍵換成底線

將當前目錄的所有*.txt文件名的空白鍵換成底線︰
cmd /e:on /v:on /c "for %f in ("* *.txt") do (set "n=%~nxf" & set "n=!n: =_!" & ren "%~ff" "!n!" )"

Reference: cmd windows replace spaces with underscores

No comments: