Bat批处理脚本
1.以管理员权限运行
1.1将下面的命令置顶
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close) && exit
2.cd command
1.如果bat script在D盘,要cd到E盘/C盘
切记:直接cd是跑不通的
c:
pause
cd C:\Program Files (x86)\Baofeng\StormPlayer
echo this is test
pause
2.以管理员权限运行,在C盘内切换
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close) && exit
:: 如果想回到盘符顶
cd ../../..
cd C:\Program Files (x86)\Baofeng\StormPlayer
echo this is test
pause