写一个bat自动备份文件到网络主机的脚本
时间: 2023-04-01 18:00:17 浏览: 148
15bat脚本备份windows的部署文件
你好,我可以回答这个问题。以下是一个备份文件到网络主机的bat脚本:
@echo off
set source=C:\Users\username\Documents
set destination=\\network\backup
set date=%date:~,4%%date:~5,2%%date:~8,2%
set time=%time:~,2%%time:~3,2%%time:~6,2%
set logfile=%destination%\backup_%date%_%time%.log
echo Backing up files from %source% to %destination% >> %logfile%
xcopy /E /C /H /Y /Z %source% %destination% >> %logfile%
echo Backup complete! >> %logfile%
echo Log file saved to %logfile%
请注意,这只是一个示例脚本,您需要根据自己的情况进行修改。
阅读全文