如何编写 BAT 文件以始终以管理员模式运行? [英] How to code a BAT file to always run as admin mode?

查看:19
本文介绍了如何编写 BAT 文件以始终以管理员模式运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 BAT 文件中有这一行:

I have this line inside my BAT file:

"Example1Server.exe"

我想在管理员模式下执行此操作.如何修改bat代码以管理员身份运行?

I would like to execute this in Administrator mode. How to modify the bat code to run this as admin?

这是正确的吗?我需要加引号吗?

Is this correct? Do I need to put the quotes?

runas /user:Administrator invis.vbs Example1Server.exe

推荐答案

您使用 runas 以特定用户身份启动程序:

You use runas to launch a program as a specific user:

runas /user:Administrator Example1Server.exe

这篇关于如何编写 BAT 文件以始终以管理员模式运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆