如何以其他用户和管理员身份从命令提示符运行程序 [英] How do I run a program from command prompt as a different user and as an admin

查看:128
本文介绍了如何以其他用户和管理员身份从命令提示符运行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 runas以其他用户身份打开命令提示符,但该命令提示符不是以管理员身份运行的
。如何使它以管理员身份运行?

I am using "runas" to open command prompt as a different user but that command prompt is not running as an admin. How can I make it run as an admin?

更新:我正在使用Windows Server 2012

UPDATE: I am using Windows Server 2012

更新:我通过运行

 runas /user:domain\username cmd.exe

然后,我尝试在此新提示符下运行一些命令,但该命令没有以提升的用户身份运行(即使它具有管理员权限) 。

Then I tried to run some commands in this new prompt but this is not running as an elevated user (even though it has Administrator privileges).

推荐答案

请参阅此处:
https://superuser.com/questions/42537/is-there-any-sudo-command-for-windows

因此,该命令对于管理员来说是这样的:

According to that the command looks like this for admin:

 runas /noprofile /user:Administrator cmd

这篇关于如何以其他用户和管理员身份从命令提示符运行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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