Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report