Automatic folder backup AutoBackUpFolder. vbs

Source: Internet
Author: User

Copy codeThe Code is as follows: '/* =================================================== ==========================================
'* The Intro automatic backup folder is scheduled to a new directory named after time. After the folder is set, it is added to the startup Item. As long as the machine program is started, it runs automatically, which is not counted as the system resource.
'* FileName AutoBackUpFolder. VBS
'* Author yongfa365
'* Version v1.0
'* Email yongfa365 [at] qq.com
'* MadeTime 17:18:33
'* LastModify 17:18:33
'* ===================================================== ============================================= */
Do While 1
Run ()
'Wscript. Sleep 1000*60*60*2
WScript. Sleep 1000 * 5' for testing. The file is backed up every five seconds to the specified folder.
Loop
Function Run ()
BackUpFolder "D: \ all the systems being designed by the company", "E: \ Automatic Software backup"
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.