其他分享
首页 > 其他分享> > Bat批处理脚本--常用命令

Bat批处理脚本--常用命令

作者:互联网

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

2.慢慢记录

标签:Bat,pause,..,--,cd,权限,管理员,常用命令,echo
来源: https://blog.csdn.net/weixin_43916074/article/details/122809376