如果我想按北京时间来切换复制文件?
以下代码就是按时间轮流切换,按一定时间把js1~js3文件夹里面的duote.js复制到yanqiao2010目录下。【代码一】
hotkeyset ("{esc}","esc")
func esc()
exit
endfunc
while 1
filecopy ("D:\yanqiao2010\js\js1\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js2\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js3\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js4\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
wend
如果我想按北京时间来切换怎么换?具体是这样:
每天晚上21:01~第二天早上8:00都只运行【代码二】中的代码
每天早上8:01~晚上21:00都只运行【代码一】中的代码
这个怎么来整合在一起呢?
【代码二】
hotkeyset ("{esc}","esc")
func esc()
exit
endfunc
while 1
filecopy ("D:\yanqiao2010\js\js1\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js2\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
wend hotkeyset ("{esc}","esc")
func esc()
exit
endfunc
while 1
If @HOUR> 8 And @HOUR <21 Then
filecopy ("D:\yanqiao2010\js\js1\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js2\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js3\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js4\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
Else
filecopy ("D:\yanqiao2010\js\js1\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
filecopy ("D:\yanqiao2010\js\js2\duote.js","D:\yanqiao2010\duote.js",1)
sleep (5000)
EndIf
wend 谢谢分享!! 精简下HotKeySet("{esc}", "esc")
While 1
If @HOUR > 8 And @HOUR <= 21 Then $x = 4
If @HOUR <= 8 And @HOUR > 21 Then $x = 2
For $i = 1 To $x
FileCopy("D:\yanqiao2010\js\js" & $i & "\duote.js", "D:\yanqiao2010\duote.js", 1)
Sleep(5000)
Next
WEnd
Func esc()
Exit
EndFunc ;==>esc 用系统自带的 任务计划 最好不过了
页:
[1]