批处理实现窗口后台运行与获取管理员权限

KBC 2024/3/27 发布 · 2024/3/27 更新 · 254 次阅读

后台运行:
if "%1"=="show" goto begin
start mshta vbscript:createobject("wscript.shell").run("%~f0 show",0)(window.close)&&exit
:begin

 

获取管理员权限:

%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"

· {{comment.createTimeStr}}
{{reply.votePoints}}
回复   – {{reply.createTimeStr}}
回复 x
标签
目录
相关操作