Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use vbs to realize server file backup method compressed file name is automatically named according to date

Shulou Source: shulou.com Published: 2022-06-03 08:36:04 11月15日 Update

Editor to share with you how to use vbs to achieve server file backup method compressed file names automatically named by the date, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

A simple backup method for server files compressed file names are automatically named by date

Dim FileName,WshShell,fs,MyCommandFileName=cstr (now) + ".RAR"

MyCommand= "rar a" + FileName+ "File or directory name to compress"

Set WshShell = WScript.CreateObject ("WScript.Shell")

Set fs=CreateObject ("Scripting.FileSystemObject")

If fs.fileExists (FileName) then

Fs.DeleteFile FileName,true

End

If WshShell.run MyCommand

Save the above file as a .VBS add scheduled task to run as long as you say it will take. Vbs as once a week

Or once a month and other scheduled tasks will automatically compress the directory you specify. Generate a date file name. rar

The above is "how to use vbs to achieve server file backup method compressed file name automatically named according to the date," all the contents of this article, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: File file name date method backup server service article task content directory not much most time more once a month directory name knowledge worship industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn NVidia Linux Shulou Information Shulou Technology