批处理命令

1.bat批处理文件 net start 命令,提示发生系统错误5,拒绝访问

原因:没有使用管理员权限

解决:在批处理文件头部添加如下代码

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

 

posted @ 2020-06-28 17:20  vvf  阅读(146)  评论(0编辑  收藏  举报