复制代码 代码如下:
'/*=========================================================================
' * Intro 定时自动备份文件夹到一个以时间命名的新目录,设置好后加到启动项里,只要一启动机器程序就会自动运行,占系统资源可以不计
' * FileName AutoBackUpFolder.VBS
' * Author yongfa365
' * Version v1.0
' * Email yongfa365[at]qq.com
' * MadeTime 2009-05-14 17:18:33
' * LastModify 2009-05-14 17:18:33
' *==========================================================================*/
Do While 1
Run()
' WScript.Sleep 1000*60*60*2
WScript.Sleep 1000 * 5 '测试用,每5秒备份一次文件到指定的文件夹
Loop
Function Run()
BackUpFolder "D:\公司所有正在设计的系统", "E:\软件自动备份"
End Function
Function BackUpFolder(S, D)
On Error Resume Next
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CreateFolder D
FSO.CopyFolder S, D & "\" & GetDateFolder
End Function
Function GetDateFolder()
GetDateFolder = Year(Now) & "-" & Right("0" & Month(Now), 2) & "-" & Right("0" & Day(Now), 2) & "-" & Right("0" & Hour(Now), 2) & "-" & Right("0" & Minute(Now), 2) & "-" & Right("0" & Second(Now), 2)
End Function
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!