China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

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!

中国DOS联盟论坛
The time now is 2026-06-22 07:21
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Share] Batch Program for Hiding Processes and Switching System Users View 2,143 Replies 22
Floor 16 Posted 2008-02-19 15:35 ·  中国 广东 东莞 电信
银牌会员
★★★
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...).
Floor 17 Posted 2008-02-19 15:45 ·  中国 广东 东莞 电信
银牌会员
★★★
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.
Floor 18 Posted 2008-02-19 15:58 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
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)
第一高手 第二高手

Floor 19 Posted 2008-02-19 16:07 ·  中国 广东 东莞 电信
银牌会员
★★★
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 ]
Floor 20 Posted 2008-02-19 16:16 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
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
第一高手 第二高手

Floor 21 Posted 2008-02-19 16:21 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,282
Posts 538
Joined 2002-11-02 00:00
23-year member
UID 129
Gender Male
Status Offline
A flame war ended, it turned out to be caused by dragging a computer!
Floor 22 Posted 2008-02-19 16:25 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,282
Posts 538
Joined 2002-11-02 00:00
23-year member
UID 129
Gender Male
Status Offline
The code does not solve the problem of too long waiting before switching, and the batch processing in the top post does not have this problem.
Floor 23 Posted 2008-02-21 16:39 ·  中国 广东 广州 鹏博士宽带
初级用户
Credits 52
Posts 24
Joined 2006-11-16 06:50
19-year member
UID 70653
Gender Male
Status Offline
Forum Jump: