- @echo off
- color 0b & cls
- echo 设置要备份的文件夹...
- set "pbuf=D:\share_file"
- echo 设置备份文件存放文件夹...
- set "tbuf=D:\share_file_backup\share_file_bk"
-
- echo 初始化压缩程序设置...
- cd \
- C:
- cd C:\Program Files\WinRAR
- set yes=ok
- echo 压缩程序在C:\Program Files\WinRAR\WinRAR.exe
-
- echo 设置备份文件名(以星期几命名,即备份文件只保存最近一周)...
- set name=%date%
- set name=%name:~-3%
- set "name=%tbuf%\share_file_%name%"
-
- if not exist "%name%" md "%name%"
- robocopy "%pbuf%" "%name%" *.* /mir
- echo 备份完毕!
复制代码
|