バックアップしたフォルダーを数世代前まで保存しながら、古いフォルダーから順に消していくためのバッチファイル

【Windows環境構築】Windowsでフォルダーをバックアップするときの世代管理

Windowsでフォルダーをバックアップするときの世代管理

バックアップしたフォルダーを数世代前まで保存しながら、古いフォルダーから順に消していくためのバッチファイル。

D:
cd D:\
dir /w
move /Y \"Hugo-bakkkk" \"Hugo-bakkkkk"
move /Y \"Hugo-bakkk" \"Hugo-bakkkk"
move /Y \"Hugo-bakk" \"Hugo-bakkk"
move /Y \"Hugo-bak" \"Hugo-bakk"
move /Y \"Hugo" \"Hugo-bak"
move /Y \"copy-Hugo-bakkkk" \"copy-Hugo-bakkkkk"
move /Y \"copy-Hugo-bakkk" \"copy-Hugo-bakkkk"
move /Y \"copy-Hugo-bakk" \"copy-Hugo-bakkk"
move /Y \"copy-Hugo-bak" \"copy-Hugo-bakk"
move /Y \"copy-Hugo" \"copy-Hugo-bak"
set path="Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="copy-Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
E:
cd E:\
dir /w
move /Y \"Hugo-bakkkk" \"Hugo-bakkkkk"
move /Y \"Hugo-bakkk" \"Hugo-bakkkk"
move /Y \"Hugo-bakk" \"Hugo-bakkk"
move /Y \"Hugo-bak" \"Hugo-bakk"
move /Y \"Hugo" \"Hugo-bak"
move /Y \"copy-Hugo-bakkkk" \"copy-Hugo-bakkkkk"
move /Y \"copy-Hugo-bakkk" \"copy-Hugo-bakkkk"
move /Y \"copy-Hugo-bakk" \"copy-Hugo-bakkk"
move /Y \"copy-Hugo-bak" \"copy-Hugo-bakk"
move /Y \"copy-Hugo" \"copy-Hugo-bak"
set path="Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="copy-Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
F:
cd F:\
dir /w
move /Y \"Hugo-bakkkk" \"Hugo-bakkkkk"
move /Y \"Hugo-bakkk" \"Hugo-bakkkk"
move /Y \"Hugo-bakk" \"Hugo-bakkk"
move /Y \"Hugo-bak" \"Hugo-bakk"
move /Y \"Hugo" \"Hugo-bak"
move /Y \"copy-Hugo-bakkkk" \"copy-Hugo-bakkkkk"
move /Y \"copy-Hugo-bakkk" \"copy-Hugo-bakkkk"
move /Y \"copy-Hugo-bakk" \"copy-Hugo-bakkk"
move /Y \"copy-Hugo-bak" \"copy-Hugo-bakk"
move /Y \"copy-Hugo" \"copy-Hugo-bak"
set path="Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="copy-Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
G:
cd G:\
dir /w
move /Y \"Hugo-bakkkk" \"Hugo-bakkkkk"
move /Y \"Hugo-bakkk" \"Hugo-bakkkk"
move /Y \"Hugo-bakk" \"Hugo-bakkk"
move /Y \"Hugo-bak" \"Hugo-bakk"
move /Y \"Hugo" \"Hugo-bak"
move /Y \"copy-Hugo-bakkkk" \"copy-Hugo-bakkkkk"
move /Y \"copy-Hugo-bakkk" \"copy-Hugo-bakkkk"
move /Y \"copy-Hugo-bakk" \"copy-Hugo-bakkk"
move /Y \"copy-Hugo-bak" \"copy-Hugo-bakk"
move /Y \"copy-Hugo" \"copy-Hugo-bak"
set path="Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="copy-Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
H:
cd H:\
dir /w
move /Y \"Hugo-bakkkk" \"Hugo-bakkkkk"
move /Y \"Hugo-bakkk" \"Hugo-bakkkk"
move /Y \"Hugo-bakk" \"Hugo-bakkk"
move /Y \"Hugo-bak" \"Hugo-bakk"
move /Y \"Hugo" \"Hugo-bak"
move /Y \"copy-Hugo-bakkkk" \"copy-Hugo-bakkkkk"
move /Y \"copy-Hugo-bakkk" \"copy-Hugo-bakkkk"
move /Y \"copy-Hugo-bakk" \"copy-Hugo-bakkk"
move /Y \"copy-Hugo-bak" \"copy-Hugo-bakk"
move /Y \"copy-Hugo" \"copy-Hugo-bak"
set path="Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="copy-Hugo-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
D:
cd D:\Users\ai
dir /w
move /Y .\"AppData-bakkkk" .\"AppData-bakkkkk"
move /Y .\"AppData-bakkk" .\"AppData-bakkkk"
move /Y .\"AppData-bakk" .\"AppData-bakkk"
move /Y .\"AppData-bak" .\"AppData-bakk"
move /Y .\"AppData" .\"AppData-bak"
move /Y .\"Desktop-bakkkk" .\"Desktop-bakkkkk"
move /Y .\"Desktop-bakkk" .\"Desktop-bakkkk"
move /Y .\"Desktop-bakk" .\"Desktop-bakkk"
move /Y .\"Desktop-bak" .\"Desktop-bakk"
move /Y .\"Desktop" .\"Desktop-bak"
move /Y .\"Documents-bakkkk" .\"Documents-bakkkkk"
move /Y .\"Documents-bakkk" .\"Documents-bakkkk"
move /Y .\"Documents-bakk" .\"Documents-bakkk"
move /Y .\"Documents-bak" .\"Documents-bakk"
move /Y .\"Documents" .\"Documents-bak"
move /Y .\"Downloads-bakkkk" .\"Downloads-bakkkkk"
move /Y .\"Downloads-bakkk" .\"Downloads-bakkkk"
move /Y .\"Downloads-bakk" .\"Downloads-bakkk"
move /Y .\"Downloads-bak" .\"Downloads-bakk"
move /Y .\"Downloads" .\"Downloads-bak"
move /Y .\"Dropbox-bakkkk" .\"Dropbox-bakkkkk"
move /Y .\"Dropbox-bakkk" .\"Dropbox-bakkkk"
move /Y .\"Dropbox-bakk" .\"Dropbox-bakkk"
move /Y .\"Dropbox-bak" .\"Dropbox-bakk"
move /Y .\"Dropbox" .\"Dropbox-bak"
move /Y .\"Music-bakkkk" .\"Music-bakkkkk"
move /Y .\"Music-bakkk" .\"Music-bakkkk"
move /Y .\"Music-bakk" .\"Music-bakkk"
move /Y .\"Music-bak" .\"Music-bakk"
move /Y .\"Music" .\"Music-bak"
move /Y .\"Pictures-bakkkk" .\"Pictures-bakkkkk"
move /Y .\"Pictures-bakkk" .\"Pictures-bakkkk"
move /Y .\"Pictures-bakk" .\"Pictures-bakkk"
move /Y .\"Pictures-bak" .\"Pictures-bakk"
move /Y .\"Pictures" .\"Pictures-bak"
move /Y .\"Videos-bakkkk" .\"Videos-bakkkkk"
move /Y .\"Videos-bakkk" .\"Videos-bakkkk"
move /Y .\"Videos-bakk" .\"Videos-bakkk"
move /Y .\"Videos-bak" .\"Videos-bakk"
move /Y .\"Videos" .\"Videos-bak"
set path="AppData-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Desktop-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Documents-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Downloads-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Dropbox-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Music-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Pictures-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Videos-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
E:
cd E:\Users\ai
dir /w
move /Y .\"AppData-bakkkk" .\"AppData-bakkkkk"
move /Y .\"AppData-bakkk" .\"AppData-bakkkk"
move /Y .\"AppData-bakk" .\"AppData-bakkk"
move /Y .\"AppData-bak" .\"AppData-bakk"
move /Y .\"AppData" .\"AppData-bak"
move /Y .\"Desktop-bakkkk" .\"Desktop-bakkkkk"
move /Y .\"Desktop-bakkk" .\"Desktop-bakkkk"
move /Y .\"Desktop-bakk" .\"Desktop-bakkk"
move /Y .\"Desktop-bak" .\"Desktop-bakk"
move /Y .\"Desktop" .\"Desktop-bak"
move /Y .\"Documents-bakkkk" .\"Documents-bakkkkk"
move /Y .\"Documents-bakkk" .\"Documents-bakkkk"
move /Y .\"Documents-bakk" .\"Documents-bakkk"
move /Y .\"Documents-bak" .\"Documents-bakk"
move /Y .\"Documents" .\"Documents-bak"
move /Y .\"Downloads-bakkkk" .\"Downloads-bakkkkk"
move /Y .\"Downloads-bakkk" .\"Downloads-bakkkk"
move /Y .\"Downloads-bakk" .\"Downloads-bakkk"
move /Y .\"Downloads-bak" .\"Downloads-bakk"
move /Y .\"Downloads" .\"Downloads-bak"
move /Y .\"Dropbox-bakkkk" .\"Dropbox-bakkkkk"
move /Y .\"Dropbox-bakkk" .\"Dropbox-bakkkk"
move /Y .\"Dropbox-bakk" .\"Dropbox-bakkk"
move /Y .\"Dropbox-bak" .\"Dropbox-bakk"
move /Y .\"Dropbox" .\"Dropbox-bak"
move /Y .\"Music-bakkkk" .\"Music-bakkkkk"
move /Y .\"Music-bakkk" .\"Music-bakkkk"
move /Y .\"Music-bakk" .\"Music-bakkk"
move /Y .\"Music-bak" .\"Music-bakk"
move /Y .\"Music" .\"Music-bak"
move /Y .\"Pictures-bakkkk" .\"Pictures-bakkkkk"
move /Y .\"Pictures-bakkk" .\"Pictures-bakkkk"
move /Y .\"Pictures-bakk" .\"Pictures-bakkk"
move /Y .\"Pictures-bak" .\"Pictures-bakk"
move /Y .\"Pictures" .\"Pictures-bak"
move /Y .\"Videos-bakkkk" .\"Videos-bakkkkk"
move /Y .\"Videos-bakkk" .\"Videos-bakkkk"
move /Y .\"Videos-bakk" .\"Videos-bakkk"
move /Y .\"Videos-bak" .\"Videos-bakk"
move /Y .\"Videos" .\"Videos-bak"
set path="AppData-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Desktop-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Documents-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Downloads-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Dropbox-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Music-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Pictures-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Videos-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
F:
cd F:\Users\ai
dir /w
move /Y .\"AppData-bakkkk" .\"AppData-bakkkkk"
move /Y .\"AppData-bakkk" .\"AppData-bakkkk"
move /Y .\"AppData-bakk" .\"AppData-bakkk"
move /Y .\"AppData-bak" .\"AppData-bakk"
move /Y .\"AppData" .\"AppData-bak"
move /Y .\"Desktop-bakkkk" .\"Desktop-bakkkkk"
move /Y .\"Desktop-bakkk" .\"Desktop-bakkkk"
move /Y .\"Desktop-bakk" .\"Desktop-bakkk"
move /Y .\"Desktop-bak" .\"Desktop-bakk"
move /Y .\"Desktop" .\"Desktop-bak"
move /Y .\"Documents-bakkkk" .\"Documents-bakkkkk"
move /Y .\"Documents-bakkk" .\"Documents-bakkkk"
move /Y .\"Documents-bakk" .\"Documents-bakkk"
move /Y .\"Documents-bak" .\"Documents-bakk"
move /Y .\"Documents" .\"Documents-bak"
move /Y .\"Downloads-bakkkk" .\"Downloads-bakkkkk"
move /Y .\"Downloads-bakkk" .\"Downloads-bakkkk"
move /Y .\"Downloads-bakk" .\"Downloads-bakkk"
move /Y .\"Downloads-bak" .\"Downloads-bakk"
move /Y .\"Downloads" .\"Downloads-bak"
move /Y .\"Dropbox-bakkkk" .\"Dropbox-bakkkkk"
move /Y .\"Dropbox-bakkk" .\"Dropbox-bakkkk"
move /Y .\"Dropbox-bakk" .\"Dropbox-bakkk"
move /Y .\"Dropbox-bak" .\"Dropbox-bakk"
move /Y .\"Dropbox" .\"Dropbox-bak"
move /Y .\"Music-bakkkk" .\"Music-bakkkkk"
move /Y .\"Music-bakkk" .\"Music-bakkkk"
move /Y .\"Music-bakk" .\"Music-bakkk"
move /Y .\"Music-bak" .\"Music-bakk"
move /Y .\"Music" .\"Music-bak"
move /Y .\"Pictures-bakkkk" .\"Pictures-bakkkkk"
move /Y .\"Pictures-bakkk" .\"Pictures-bakkkk"
move /Y .\"Pictures-bakk" .\"Pictures-bakkk"
move /Y .\"Pictures-bak" .\"Pictures-bakk"
move /Y .\"Pictures" .\"Pictures-bak"
move /Y .\"Videos-bakkkk" .\"Videos-bakkkkk"
move /Y .\"Videos-bakkk" .\"Videos-bakkkk"
move /Y .\"Videos-bakk" .\"Videos-bakkk"
move /Y .\"Videos-bak" .\"Videos-bakk"
move /Y .\"Videos" .\"Videos-bak"
set path="AppData-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Desktop-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Documents-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Downloads-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Dropbox-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Music-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Pictures-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Videos-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
G:
cd G:\Users\ai
dir /w
move /Y .\"AppData-bakkkk" .\"AppData-bakkkkk"
move /Y .\"AppData-bakkk" .\"AppData-bakkkk"
move /Y .\"AppData-bakk" .\"AppData-bakkk"
move /Y .\"AppData-bak" .\"AppData-bakk"
move /Y .\"AppData" .\"AppData-bak"
move /Y .\"Desktop-bakkkk" .\"Desktop-bakkkkk"
move /Y .\"Desktop-bakkk" .\"Desktop-bakkkk"
move /Y .\"Desktop-bakk" .\"Desktop-bakkk"
move /Y .\"Desktop-bak" .\"Desktop-bakk"
move /Y .\"Desktop" .\"Desktop-bak"
move /Y .\"Documents-bakkkk" .\"Documents-bakkkkk"
move /Y .\"Documents-bakkk" .\"Documents-bakkkk"
move /Y .\"Documents-bakk" .\"Documents-bakkk"
move /Y .\"Documents-bak" .\"Documents-bakk"
move /Y .\"Documents" .\"Documents-bak"
move /Y .\"Downloads-bakkkk" .\"Downloads-bakkkkk"
move /Y .\"Downloads-bakkk" .\"Downloads-bakkkk"
move /Y .\"Downloads-bakk" .\"Downloads-bakkk"
move /Y .\"Downloads-bak" .\"Downloads-bakk"
move /Y .\"Downloads" .\"Downloads-bak"
move /Y .\"Dropbox-bakkkk" .\"Dropbox-bakkkkk"
move /Y .\"Dropbox-bakkk" .\"Dropbox-bakkkk"
move /Y .\"Dropbox-bakk" .\"Dropbox-bakkk"
move /Y .\"Dropbox-bak" .\"Dropbox-bakk"
move /Y .\"Dropbox" .\"Dropbox-bak"
move /Y .\"Music-bakkkk" .\"Music-bakkkkk"
move /Y .\"Music-bakkk" .\"Music-bakkkk"
move /Y .\"Music-bakk" .\"Music-bakkk"
move /Y .\"Music-bak" .\"Music-bakk"
move /Y .\"Music" .\"Music-bak"
move /Y .\"Pictures-bakkkk" .\"Pictures-bakkkkk"
move /Y .\"Pictures-bakkk" .\"Pictures-bakkkk"
move /Y .\"Pictures-bakk" .\"Pictures-bakkk"
move /Y .\"Pictures-bak" .\"Pictures-bakk"
move /Y .\"Pictures" .\"Pictures-bak"
move /Y .\"Videos-bakkkk" .\"Videos-bakkkkk"
move /Y .\"Videos-bakkk" .\"Videos-bakkkk"
move /Y .\"Videos-bakk" .\"Videos-bakkk"
move /Y .\"Videos-bak" .\"Videos-bakk"
move /Y .\"Videos" .\"Videos-bak"
set path="AppData-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Desktop-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Documents-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Downloads-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Dropbox-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Music-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Pictures-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Videos-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
H:
cd H:\Users\ai
dir /w
move /Y .\"AppData-bakkkk" .\"AppData-bakkkkk"
move /Y .\"AppData-bakkk" .\"AppData-bakkkk"
move /Y .\"AppData-bakk" .\"AppData-bakkk"
move /Y .\"AppData-bak" .\"AppData-bakk"
move /Y .\"AppData" .\"AppData-bak"
move /Y .\"Desktop-bakkkk" .\"Desktop-bakkkkk"
move /Y .\"Desktop-bakkk" .\"Desktop-bakkkk"
move /Y .\"Desktop-bakk" .\"Desktop-bakkk"
move /Y .\"Desktop-bak" .\"Desktop-bakk"
move /Y .\"Desktop" .\"Desktop-bak"
move /Y .\"Documents-bakkkk" .\"Documents-bakkkkk"
move /Y .\"Documents-bakkk" .\"Documents-bakkkk"
move /Y .\"Documents-bakk" .\"Documents-bakkk"
move /Y .\"Documents-bak" .\"Documents-bakk"
move /Y .\"Documents" .\"Documents-bak"
move /Y .\"Downloads-bakkkk" .\"Downloads-bakkkkk"
move /Y .\"Downloads-bakkk" .\"Downloads-bakkkk"
move /Y .\"Downloads-bakk" .\"Downloads-bakkk"
move /Y .\"Downloads-bak" .\"Downloads-bakk"
move /Y .\"Downloads" .\"Downloads-bak"
move /Y .\"Dropbox-bakkkk" .\"Dropbox-bakkkkk"
move /Y .\"Dropbox-bakkk" .\"Dropbox-bakkkk"
move /Y .\"Dropbox-bakk" .\"Dropbox-bakkk"
move /Y .\"Dropbox-bak" .\"Dropbox-bakk"
move /Y .\"Dropbox" .\"Dropbox-bak"
move /Y .\"Music-bakkkk" .\"Music-bakkkkk"
move /Y .\"Music-bakkk" .\"Music-bakkkk"
move /Y .\"Music-bakk" .\"Music-bakkk"
move /Y .\"Music-bak" .\"Music-bakk"
move /Y .\"Music" .\"Music-bak"
move /Y .\"Pictures-bakkkk" .\"Pictures-bakkkkk"
move /Y .\"Pictures-bakkk" .\"Pictures-bakkkk"
move /Y .\"Pictures-bakk" .\"Pictures-bakkk"
move /Y .\"Pictures-bak" .\"Pictures-bakk"
move /Y .\"Pictures" .\"Pictures-bak"
move /Y .\"Videos-bakkkk" .\"Videos-bakkkkk"
move /Y .\"Videos-bakkk" .\"Videos-bakkkk"
move /Y .\"Videos-bakk" .\"Videos-bakkk"
move /Y .\"Videos-bak" .\"Videos-bakk"
move /Y .\"Videos" .\"Videos-bak"
set path="AppData-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Desktop-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Documents-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Downloads-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Dropbox-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Music-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Pictures-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%
set path="Videos-bakkkkk"
del /f/s/q %path% > nul
rmdir /s/q %path%

BunBackupの[拡張子|.lbk]を改変する

[Windowsでフォルダーをバックアップするときの世代管理]の前提として、[BunBackup]を使ったバックアップ行為があります。 [BunBackup]はコピースピードが遅いので、根本的な改善が必要かもしれません。 しかし、現在のところ、[BunBackup]を使っています。