How to use vbs to realize server file backup method compressed file name is automatically named according to date
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!