LoginSignup
2
2

More than 5 years have passed since last update.

バックアップの退避ファイル除去バッチ

Posted at

WinMergeやVimで編集した跡にできる元ファイルのバックアップ

戻す可能性があって残してたけどもういらない
でも・・・
いちいち探して消すのもめんどくさいって時にこいつですよ

マージしたときとかに有用かと

BakFIleDeleter
@echo off
rem title
title bak file Deleter
set /p pushKey="バックアップ用一時ファイルを削除しますか?(y/n)"
if "%pushKey%" == "y" goto KILL

if "%pushKey%" == "Y" goto KILL

if "%pushKey%" == "yes" goto KILL

if "%pushKey%" == "YES" goto KILL
goto EXT

:KILL
rem bak用
for /r %%A in ( *.bak ) do ( if exist "%%A" ( del /s /q "%%A"))
rem Vimとか用
rem for /r %%B in ( *.*~ ) do ( if exist "%%B" ( del /s /q "%%B"))
rem OLDファイル用
rem for /r %%C in ( *.OLD ) do ( if exist "%%C" ( del /s /q "%%C"))
goto EXT

:EXT
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2