标签:
以管理员的身份去执行一个程序:runas /savecred /user:administrator app (app是一个可执行程序)
@echo off
:START
cls
@echo ======================================
@echo A. 管理员方式打开 CMD 命令窗
@echo B. 管理员方式运行 QQ浏览器
@echo C. 桌面运维软件
@echo D. PS
@echo Q. 退出
@echo 0. 关机
@echo ======================================
echo.
set /p command=请选择需要执行的命令代码:
if "%command%" == "a" goto COM-A
if "%command%" == "b" goto COM-B
if "%command%" == "c" goto COM-C
if "%command%" == "d" goto COM-D
if "%command%" == "q" goto END
if "%command%" == "0" goto DOWN
goto START
:COM-A
runas /savecred /user:administrator cmd
pause
goto START
:COM-B
start C:\Users\809693\AppData\Local\Google\Chrome\Application\chrome.exe
runas /savecred /user:administrator "E:\Program Files\QQBrowser\QQBrowser.exe"
pause
goto START
:COM-C
start \\10.118.250.22
pause
goto START
:COM-D
runas /savecred /user:administrator "E:\Program Files\Adobe_Photoshop_CS5_jjb\Photoshop.exe"
pause
goto START
:DOWN
shutdown -s -t 30
pause
goto START
:END
exit
标签:
原文地址:http://www.cnblogs.com/kevin-yuan/p/4478196.html