ファイル番号のリストを作成するのに、短い.bat
ファイルを使用しています。たとえば:バッチファイルを制限する
C:
cd\Users\garys\Documents
dir *.xlsm /s /b > %userprofile%\Desktop\xlsm.txt
のようなものが生成されます:
C:\Users\garys\Documents\My Spreadsheets\autocorrect.xlsm
C:\Users\garys\Documents\My Spreadsheets\column id.xlsm
C:\Users\garys\Documents\My Spreadsheets\control word.xlsm
C:\Users\garys\Documents\My Spreadsheets\Data.xlsm
C:\Users\garys\Documents\My Spreadsheets\Dinar.xlsm
をしかし、私は使用している場合:
C:
cd\Users\garys\Documents
dir *.xls /s /b > %userprofile%\Desktop\xls.txt
私の結果のテキストファイルはとして.XLS拡張子を持つファイルが含まれていますよくファイルとして.xlsmおよびxlsx拡張。
どのように私は.xlsmとの.xlsxファイルを無視する.bat
スクリプトを変更できますか?
'DIR'を' FINDSTR'コマンドにパイプし、 '/ E'オプションを使って文字列の最後にXLSを見つけるように指示します。 – Squashman