本文主要是介绍备份文件的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%
+++++++++++++++++++++++++++++++++++++++++++++++++
这篇关于备份文件的BAT脚本的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!