將當前目錄的所有*.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
Showing posts with label cmd. Show all posts
Showing posts with label cmd. Show all posts
Tuesday, June 26, 2018
Tuesday, June 21, 2016
cmd: 找檔案是否包含某一段文字
剛剛在網上找到一個找檔案文字的script,供參考︰
- 打開cmd.exe
- 到文件目錄中
- 輸入以下指令
- 第1個參數/M 是設定只輸出文件名
- 第2個參數“abc”是Pattern
- 第3個參數是文件
findStr /M "abc" *
Subscribe to:
Posts (Atom)