![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-11 23:47 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » Batch script to copy files every three minutes |
| Printable Version 3,169 / 23 |
| Floor16 happygogo | Posted 2007-03-13 05:47 |
| 新手上路 Posts 5 Credits 10 | |
| Floor17 axi | Posted 2007-03-13 06:52 |
| 中级用户 Posts 93 Credits 238 From GZ | |
|
Provide a VBS script as follows:
Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") do objFSO.CopyFile "c:\log\log.log" , "d:\logbak\log.log", OverwriteExisting WScript.Sleep (1000*60*3) ' Delay for 3 minutes loop Copy the above code into Notepad, then save it as copy.vbs. Double-click this file to execute file copying in the background. Note that the D:\logbak directory must exist, otherwise an error will occur. To terminate, close the wScript.exe process. |
|
| Floor18 anqing | Posted 2007-03-13 08:21 |
| 高级用户 Posts 413 Credits 859 | |
|
The first sentence represents "Constant OverwriteExisting is True". But what does the first sentence mean is not quite clear?
|
|
| Floor19 axi | Posted 2007-03-13 12:23 |
| 中级用户 Posts 93 Credits 238 From GZ | |
|
First, create a constant named OverwriteExisting and set its value to True. Then use this constant to tell the FileSystemObject that it can overwrite the existing instance of the target file. The do...loop statement repeats the statement block when the condition is True or before the condition becomes True. Here, it repeats the CopyFile command.
[ Last edited by axi on 2007-3-13 at 07:40 AM ] |
|
| Floor20 DFWYYY | Posted 2009-05-26 02:23 |
| 新手上路 Posts 1 Credits 1 | |
|
Let me download and try it
|
|
| Floor21 wtp791211 | Posted 2009-05-26 07:07 |
| 初级用户 Posts 20 Credits 34 | |
|
What the friend on the 4th floor said makes sense. It's really annoying to have a batch DOS window there. But you can use this method: convert the batch script of the friend on the 2nd floor into an EXE file using a DOS-to-EXE software, so that you don't need to see the DOS window. Personally, I think this is relatively perfect.
|
|
| Floor22 msg753 | Posted 2009-05-26 11:51 |
| 新手上路 Posts 10 Credits 17 | |
|
Hehe, newbies, come and take a look.
|
|
| Floor23 mfcliu | Posted 2009-05-27 00:16 |
| 新手上路 Posts 4 Credits 13 | |
|
Learning
|
|
| Floor24 abc2121 | Posted 2009-05-27 03:19 |
| 新手上路 Posts 1 Credits 1 | |
| Prev 1 2 |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |