.bat以管理员身份运行

原文地址:https://blog.csdn.net/stranger_hello/article/details/82257947

@echo off

:获取管理员权限

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

:保持当前目录下运行

cd /d "%~dp0"

posted @ 2019-03-26 18:00  瘋子朱磊  阅读(866)  评论(0编辑  收藏  举报