0
搜索這些文件中的目錄中的文件和子目錄和編輯特定行內搜索目錄中的文件和子目錄和編輯特定行。這些文件
C:\Users\user\Desktop\backup>dir
Volume in drive C has no label.
Volume Serial Number is C8D8-4C1B
Directory of C:\Users\user\Desktop\backup
02/13/2017 03:02 PM <DIR> .
02/13/2017 03:02 PM <DIR> ..
02/13/2017 02:21 PM <DIR> blog
02/13/2017 02:21 PM <DIR> css
02/13/2017 02:21 PM <DIR> forgot
02/13/2017 02:21 PM <DIR> img
02/13/2017 02:21 PM 13,845 index.htm
02/13/2017 02:21 PM <DIR> pages
02/13/2017 02:21 PM <DIR> photo
02/13/2017 02:21 PM <DIR> photos
02/13/2017 02:21 PM <DIR> profile
02/13/2017 02:21 PM <DIR> signin
02/13/2017 03:11 PM 89 test.bat
02/13/2017 02:21 PM <DIR> theme
02/13/2017 02:21 PM <DIR> view
2 File(s) 13,934 bytes
13 Dir(s) 74,300,223,488 bytes free
我搜索計算器上的答案,發現這個代碼:
for /R %f in (index.htm)" do "x"
和
findstr /v /i "body" index.htm > indexnew.htm
我想出了與此代碼失敗:
"for /R %f in (index.htm)" do "findstr /v /i "shaw" index.htm > indexnew.htm"
pause
失敗。
我需要操作的主目錄和子目錄中的文件名爲index.htm的刪除特定的行或與在其中單詞「肖」。
您需要使用變量作爲FINDSTR將解析的文件名。 – Squashman
我將如何調用for變量? %F? –