CMD runAs 命令詳解 for Server 2012


runAs 允許用戶以異於當前登錄權限方式,運行特定工具/程序。

runAs 最先內置於 Windows Vista 操作係統。

另請參閱: cmd     PowerShell

基本用法     詳細用法

runas /user:administrator cmd
			

基本語法

runAs [{/noprofile | /profile}] [/env] [{/netonly | /savecred}] [/smartcard] [/showtrustlevels] [/trustlevel] /user:<UserAccountName> "<ProgramName> <PathToProgramFile>"
			

Windows 10

runAs [[/noprofile | /profile] [/env] [/netonly | /savecred]]
      /user:<UserName> program
 
runAs [[/noprofile | /profile] [/env] [/savecred]]
      smartcard [/user:<UserName>] program
 
runAs /trustlevel:<TrustLevel> program
			

選項參數

參數 EN 解釋 中文翻譯 備注
/profile

Loads the user's profile. This is the default.

This parameter cannot be used with the /netonly parameter.

加載用戶配置文件。這為默認。

該參數不可以與 /netonly 參數一起使用。

/no profile

Specifies that the user's profile is not to be loaded.

This allows the application to load more quickly, but it can also cause a malfunction in some applications.

指定不加載用戶配置文件。

這允許應用程序更快加載,但也可能導緻某些應用程序故障。

/env Specifies that the current network environment be used instead of the user's local environment. 指定使用當前網絡環境,而不是用戶的本地環境。
/netonly

Indicates that the user information specified is for remote access only.

This parameter cannot be used with the /profile parameter.

指示指定的用戶信息僅用於遠程訪問。

此參數不可以與 /profile 參數一起使用。

/savecred

Indicates if the credentials have been previously saved by this user.

This parameter is not available and will be ignored on Windows Vista Home or Windows Vista Starter Editions.

This parameter cannot be used with the /smartcard parameter.

指示此用戶先前是否已保存證書。

此參數在 Windows Vista 傢庭版或 Windows Vista Starter edition 入門版不可用且會被忽略。

此參數不可以與 /smartcard 參數一起使用。

/smartcard

Indicates whether the credentials are to be supplied from a smartcard.

This parameter cannot be used with the /savecred parameter.

指示是否從智能卡提供證書。

此參數不可以與 /savecred 參數一起使用。

/showtrustlevels Displays the trust levels that can be used as arguments to /trustlevel. 顯示可以用作 /trustlevel 自變量的信任級彆。
/trustlevel

Specifies the level of authorization at which the application is to run.

Use /showtrustlevels to see the trust levels available.

指定要運行應用程序的授權級彆。

可使用 /showtrustlevels 查看可用信任級彆。

/user:<UserAccountName> "<ProgramName> <PathToProgramFile>"

Specifies the name of the user account under which to run the program, the program name, and the path to the program file.

The user account name format should be <User>@<Domain> or <Domain>\<UserAccountName>.

指定要運行程序的用戶帳戶名、程序名及程序文件路徑。

用戶帳號名格式應為 <User>@<Domain> 或 <Domain>\<UserAccountName>。

/? Displays help at the command prompt. 在命令提示符處顯示幫助。

基本用法

功能 命令 解釋 備注
權限 runas /user:administrator cmd 以 administrator 管理員權限運行 cmd 命令 需要 administrator 管理員密碼 (管理員無口令不工作)
runas /noprofile /user:Administrator cmd 以 administrator 管理員權限運行 cmd 命令 需要 administrator 管理員密碼 (管理員無口令不工作)
幫助 runAs /? 展示幫助信息

 

版權聲明: 本文為獨傢原創稿件,版權歸 樂數軟件 ,未經許可不得轉載。