Created
June 19, 2010 13:46
-
-
Save namutaka/444909 to your computer and use it in GitHub Desktop.
Windowsバックアップ ツール
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
@ECHO OFF | |
REM 簡易バックアップ バッチ | |
REM 引数のファイル群のタイムスタンプを付けたコピーを作成する | |
REM ファイル名に、& , = が含まれる場合は正しく動かない | |
SETLOCAL | |
SET BACKUP_DIR=_backup | |
:BEGIN | |
if "%~1" == "" GOTO FINISH | |
SET T=%~t1 | |
SET T=%T: =_% | |
SET T=%T:/=% | |
SET T=%T::=% | |
echo "%~1" | |
if EXIST "%~1" ( | |
copy /-Y "%~1" "%~dp1%BACKUP_DIR%\%~n1_%T%%~x1" | |
) ELSE ( | |
echo Not Found "%~1". | |
) | |
PAUSE | |
SHIFT | |
GOTO BEGIN | |
:FINISH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment