|
happygogo
新手上路

积分 10
发帖 5
注册 2006-10-18
状态 离线
|
|
2007-3-13 05:47 |
|
|
axi
中级用户
   脚本爱好者
积分 238
发帖 93
注册 2007-3-11 来自 GZ
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
向楼主提供一个VBS脚本如下:
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) '延时3分钟
loop
把以上代码复制到记事本中,再另存为 copy.vbs 双击此文件即可在后台执行复制文件,要注意是D:\logbak目录一定要存在,否则出错。要终止,请关闭 wScript.exe 进程。
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.
|
|
2007-3-13 06:52 |
|
|
anqing
高级用户
   
积分 859
发帖 413
注册 2006-8-14
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
Const OverwriteExisting = True
第一句代表什么不太明白?
The first sentence represents "Constant OverwriteExisting is True". But what does the first sentence mean is not quite clear?
|
|
2007-3-13 08:21 |
|
|
axi
中级用户
   脚本爱好者
积分 238
发帖 93
注册 2007-3-11 来自 GZ
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
首先创建一个名为 OverwriteExisting 的常量并将其值设置为 True,再使用此常量告诉 FileSystemObject 可以对目标文件的现有实例进行覆盖。 do ... loop 语句就是当条件为 True 时或条件变为 True 之前,重复执行语句块,在这里就是重复执行复制文件(CopyFile)命令。
Last edited by axi on 2007-3-13 at 07:40 AM ]
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 ]
|
|
2007-3-13 12:23 |
|
|
DFWYYY
新手上路

积分 1
发帖 1
注册 2009-5-25
状态 离线
|
|
2009-5-26 02:23 |
|
|
wtp791211
初级用户
 
积分 34
发帖 20
注册 2006-10-15
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
4楼的朋友说得有道理,就是有个批DOS窗口在那里确实烦人,不过可以用这个办法,把2楼朋友的批处理,用一个DOS转EXE的软件,转成EXE执行,这样就可以不用看到DOS窗口了.我个人觉得这样比较完美
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.
|
|
2009-5-26 07:07 |
|
|
msg753
新手上路

积分 17
发帖 10
注册 2008-7-27
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
呵呵新手来看看。
Hehe, newbies, come and take a look.
|
|
2009-5-26 11:51 |
|
|
mfcliu
新手上路

积分 13
发帖 4
注册 2009-5-18
状态 离线
|
|
2009-5-27 00:16 |
|
|
abc2121
新手上路

积分 1
发帖 1
注册 2008-7-12
状态 离线
|
|
2009-5-27 03:19 |
|