- 帖子
- 39
- 积分
- 56
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2020-2-5
|
2楼
发表于 2020-3-23 13:09
| 只看该作者
@echo off
::管理员权限运行
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
: Backup to bakFolder must be change youself
::[Edit][所要备份到的指定目录]
set baktagFolder="D:\backup"
: U want backups Folder must be change Youself
::[Edit][需要备份的文件]
set sorFolder="D:\电子说明书"
: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% |
|