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

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

问题描述

我有这行我的BAT文件中:

 Example1Server.exe

我想在管理员模式下执行此。如何修改蝙蝠code运行此作为管理员?

这是正确的?我需要把报价?

 的runas / user:用户管理员invis.vbs Example1Server.exe


解决方案

您使用运行方式来启动程序作为一个特定的用户:

 的runas / user:用户管理员Example1Server.exe

I have this line inside my BAT file:

"Example1Server.exe"

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

解决方案

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

runas /user:Administrator Example1Server.exe

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

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