Created
September 28, 2011 08:12
-
-
Save cha-sys/1247320 to your computer and use it in GitHub Desktop.
指定フォルダの更新日時が7日前のPDFをファイルを削除するバッチファイル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem ~~~.pdf以外の更新日時が7日前のPDFファイルを削除するバッチファイル | |
rem 削除しないPDFファイルをコピーして退避 | |
copy "C:\foo\bar.pdf" "C:\foo\bar.pdf2" | |
rem 更新日時が7日前のPDFを検索し、削除 | |
forfiles /P "C:\foo\bar\pdf" /S /M *.pdf /C "cmd /c if @isdir==FALSE del /s @path" /D -7 | |
rem退避したファイルを元の名前に直す | |
ren "C:\foo\bar.pdf2" "bar.pdf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment