Originally posted by fastslz at 2008-2-19 03:30 PM:
1、批处理计算下一分钟是不精确的(即使做到很精确代码还更复杂),vbs分秒不差
2、残留任务没问题
3、e 快捷方式也没问题
4、也假死现象
5、总之~因个人系统状况而定
1、这个程序无需十分精确,可提前执行几秒或缓迟几秒都不在话下!
2、我的问题就是不想存在已过时的任务计划或留下执行痕迹。
3及4、这个可能跟我的系统有关(用BeTwin拖机中...)
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Originally posted by fastslz at 2008-2-19 03:30 PM:
1、批处理计算下一分钟是不精确的(即使做到很精确代码还更复杂),vbs分秒不差
2、残留任务没问题
3、e 快捷方式也没问题
4、也假死现象
5、总之~因个人系统状况而定
Set WsShell = CreateObject("WScript.Shell")
Set objWMI = Getobject("Winmgmts:")
Set Process=objWMI.ExecQuery("Select * From Win32_Process Where Name='Explorer.exe'")
For Each objProcess In Process
intReturn = objProcess.Terminate(1)
Next
WsShell.Run ("%Comspec% /c "&Chr(34) &"sc config Schedule start= auto&net start Schedule" &Chr(34)),vbHide
Wscript.sleep 1000
SithTime = FormatDateTime (DateAdd("s",20,Time) ,0)
WsShell.Run ("%Comspec% /c "&Chr(34) &"at " &SithTime & " /interactive %SystemRoot%\Explorer.exe" &Chr(34)),vbHide
Wscript.sleep 30000
WsShell.Run ("%Comspec% /c "&Chr(34) &"at /delete /yes&echo 查看是否执行成功&pause" &Chr(34))'Originally posted by chishingchan at 2008-2-19 12:24:
rem 添加一个任务计划(下分钟起执行)
at %h%:%m% /interactive %SystemRoot%\Explorer.exe>nul 2>nul
rem 延时删除全部任务计划
call :ProcDelay 800
......
Originally posted by fastslz at 2008-2-19 03:58 PM:
下分钟起执行at,call :ProcDelay 800也就是等于延迟8秒后删除全部任务计划(不就是没执行at计划就被删除了)
@echo off
if "%1" == "hide" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" hide",0)(window.close)&&exit
:begin
>tmp.vbs echo Wscript.echo FormatDateTime (DateAdd("s",20,Time) ,0)
for /f "delims=" %%i in ('cscript.exe //nologo tmp.vbs') do set aDate=%%i
del tmp.vbs
TaskKill /f /im Explorer.exe>nul 2>nul
sc config schedule start= auto>nul 2>nul
net start Schedule>nul 2>nu
at %aDate% /interactive %SystemRoot%\Explorer.exe>nul 2>nul
ping/n 30 127.1.0 >nul 2>nul
at /delete /yes