禁用或启用任务管理器

执行命令前确认当前用户在管理员组里

以管理员权限启动命令提示符cmd,

在命令提示符cmd里, 执行以下命令禁用任务管理器

reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableTaskMgr /t reg_dword /d "1" /f

在命令提示符cmd里, 执行以下命令启用任务管理器

reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system" /f

vbs禁用任务管理器

复制代码
Set shell = CreateObject("wscript.shell")
Do
shell.Run "cmd /c taskkill /f /im taskmgr.exe",vbHide'杀死taskmgr进程
WScript.Sleep 500 '每0.5秒执行一次
Loop

bat脚本

复制代码
@echo off
if "%1"=="hide" goto CmdBegin
start mshta vbscript:createobject("wscript.shell").run("""%~0"" hide",0)(window.close)&&exit
:CmdBegin
:: 检查是否以管理员权限运行
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo 请求管理员权限...
    PowerShell -Command "Start-Process '%~dpnx0' -Verb RunAs"
    exit /b
)

:: 以下是你的实际批处理命令
:loop
taskkill /F /IM Taskmgr.exe
set /a num+=1
if %num% lss 1000000 goto :loop
:: 在这里添加你的实际命令
pause

该程序的操作实际是开启后挂在后台循环100万次 kill掉taskmgr.exe的命令的bat脚本

相关推荐
goehou12 小时前
让 AI 替我操作这台电脑,先把手能伸多远定下来
windows·自动化·权限管理·ai agent
公子小六13 小时前
基于.NET的Windows窗体编程之WinForms数据持久化(1)
windows·microsoft·c#·.net·winforms
2601_967987371 天前
安装 Redis 或 Redis Stack
linux·windows·redis·macos·安装
xbzb1 天前
自定义 yum 软件源:Linux 上 createrepo,Windows 上纯 Python 也能造
linux·运维·windows·python·yum·createrepo
武雄(小星Ai)1 天前
Ollama报llama-server binary not found排坑实录:服务活着引擎没了
人工智能·windows·大模型·ollama·排坑
叼烟扛炮2 天前
[LangChain] 学习笔记(06):突破大模型限制——结构化输出(Structured Output)
windows·笔记·学习·langchain
Thneonl2 天前
桌宠穿透不是一行 SetWindowLong
windows·程序员
艺杯羹3 天前
Windows原生软件锁设计:从暴力杀进程丢数据到零轮询事件驱动架构
windows·系统架构·开源·开源软件·内存管理·开源协议
csdn_aspnet4 天前
Redis 入门:Windows、Mac安装指南
数据库·windows·redis·缓存·mac
没差c4 天前
winsw将jar、nginx等注册为Windows服务
windows·nginx·jar