复制代码 代码如下:
'/*=========================================================================
' * 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
'/*=========================================================================
' * 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
标签:
文件夹,自动备份,vbs
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
内蒙古资源网 Copyright www.nmgbbs.com
暂无“文件夹定时自动备份 AutoBackUpFolder.vbs”评论...