侧边栏壁纸
博主头像
Eoser's page! 博主等级

@学习@生活@自己

  • 累计撰写 114 篇文章
  • 累计创建 29 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

让bat脚本用管理员权限运行

eoser
2023-03-23 / 0 评论 / 0 点赞 / 1 阅读 / 0 字

第一个,WIN10亲测可以

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

第二个,WIN10亲测可以

%1 %2 
ver|find "5.">nul&&goto :st 
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :st","","runas",1)(window.close)&goto :eof 
:st 
copy "%~0" "%windir%\system32\"
0

评论区