备份文件的BAT脚本

备份文件的bat脚本

Backup_Files.bat
+++++++++++++++++++++++++++++++++++++++++++
@echo off
: Backup to bakFolder must be change youself
::[Edit]
set baktagFolder="d:\backup"
: U want backups Folder must be change Youself
::[Edit]
set sorFolder="C:\Documents and Settings\root\Favorites"
:set time to vir
set stry=%date:~0,4%&& set strm=%date:~5,2%&& set strd=%date:~8,2%
set strh=%time:~0,2%&& set strmin=%time:~3,2%
set strdatt=%stry%%strm%%strd%
set strlongdatt=%strdatt%%strh%%strmin%
::[Edit][改变文件名字命名规则]
: Backup to bakFolder by Date (year month day)& Time (hour min)
if not exist %baktagFolder% mkdir %baktagFolder%
if not exist %baktagFolder%\%strdatt% mkdir %baktagFolder%\%strdatt%
:: cd /d %sorFolder%
xcopy %sorFolder%\* /s/y %baktagFolder%\%strdatt%
+++++++++++++++++++++++++++++++++++++++++++++++++

你可能感兴趣的:(C++,c,脚本,C#)