Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 1,282 Posts 538 Joined 2002-11-02 00:00 23-year member UID 129 Gender Male
Status Offline
Originally posted by fastslz at 2008-2-19 03:30 PM:
1. Batch processing for calculating the next minute is not precise (even if made very precise, the code will be more complicated), while VBS is accurate to the second.
2. Residual tasks are no problem.
3. The E shortcut is also no problem.
4. There is also a situation of unresponsiveness.
5. In short~ It depends on the individual system conditions.
1. This program does not need to be very precise. It can be executed a few seconds in advance or delayed a few seconds without any problem!
2. My problem is that I don't want to have outdated task plans or leave execution traces.
3 and 4. This may be related to my system (using BeTwin to share the screen...).
Credits 1,282 Posts 538 Joined 2002-11-02 00:00 23-year member UID 129 Gender Male
Status Offline
After the first run and entering the SYSTEM account, log out of SYSTEM, press Ctrl + Alt + Del twice, and log in with the Administrator account to make this shortcut disappear. Please other friends test whether the code on the top floor has such a situation.
Credits 5,493 Posts 2,315 Joined 2006-05-01 10:41 20-year member UID 54766 Gender Male From 上海
Status Offline
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 Add a task plan (execute starting next minute)
at %h%:%m% /interactive %SystemRoot%\Explorer.exe>nul 2>nul
rem Delay to delete all task plans
call :ProcDelay 800
......
Execute at starting next minute, call :ProcDelay 800 is equal to delaying for 8 seconds to delete all task plans (that is, the at plan is deleted before it is executed)
Credits 1,282 Posts 538 Joined 2002-11-02 00:00 23-year member UID 129 Gender Male
Status Offline
Originally posted by fastslz at 2008-2-19 03:58 PM:
Execute at starting from the next minute, call :ProcDelay 800 which is equal to delaying for 8 seconds and then deleting all task schedules (that is, the at schedule is deleted without execution)
It has already logged in to the SYSTEM account, do I need to say more?!
Moreover, the batch file on the top floor also deletes the execution traces. If you don't believe it, you can check the task schedules after logging in to SYSTEM (no AT?).
[ Last edited by chishingchan on 2008-2-19 at 04:10 PM ]
Credits 5,493 Posts 2,315 Joined 2006-05-01 10:41 20-year member UID 54766 Gender Male From 上海
Status Offline
```@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
```
This is a streamlined batch processing without time errors by yourself