How run file .bat as admin

2019-09-17 06:41发布

I have question how run file .bat as admin? How run cmd as admin in file bat?

I must run command on cmd: %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -px "MyKey" c:\key.xml -pri

Please help and have any tips or any good material.

2条回答
可以哭但决不认输i
2楼-- · 2019-09-17 06:45

open start menu by pressing windows key type cmd right click cmd and select Run as administrator this will open the command prompt in administrator mode and then you can run your command as an administrator.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-09-17 07:05

Use RUNAS command for this purpose like below. See help using runas /? in command prompt

runas /user:administrator "%windir%\Microsoft.NET\Framework\v2.0.5
0727\aspnet_regiis.exe -px "MyKey" d:\key.xml -pri"

Enter the password for administrator:
查看更多
登录 后发表回答