命令行大全

runas

舞夕之 发表于 2020-06-28 16:26浏览次数:

Runas命令使用户能够以您自己或其他用户的身份在另一台计算机上执行程序。

查看英文版

目录:

1 runas 运行系统环境

2 runas 语法

3 runas 示例

runas 运行系统环境

Windows xp

Windows vista

Windows 2000

Windows 7

Windows 8

Windows 10

runas 语法

WindowsVista及以后的语法
RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]         /user:program
RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]         /smartcard [/user:] program
RUNAS /trustlevel:program
/noprofile 指定不应加载用户的配置文件,这允许应用程序更快地加载,但可能导致某些应用程序故障。
/profile 默认设置,指定应加载用户的配置文件。
/env 使用当前环境而不是用户的环境。
/ netonly 如果指定的凭据仅用于远程访问,则使用。
/ savecred 使用用户先前保存的凭据。
/ smartcard 如果凭据是从智能卡提供的,则使用。
/ user 的格式应为USER @ DOMAIN或DOMAIN \ USER
/ showtrustlevels 显示可用作/ trustlevel参数的信任级别。
/ trustlevel 应该是/ showtrustlevels中枚举的级别之一。
program EXE命令行。例子见下文。
示例:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""
注意:
仅在出现提示时输入用户密码。
注意:
开关/ profile与/ netonly不兼容。
注意:
开关/ savecred与/ smartcard不兼容。

Windows XP和早期语法
RUNAS [/profile] [/env] [/netonly] /user:program
/profile 如果需要加载用户的配置文件,请使用。
/env 使用当前环境而不是用户的环境。
/netonly 如果指定的凭据仅用于远程访问,则使用。
/用户 的格式应为USER @ DOMAIN或DOMAIN \ USER
program EXE命令行。例子见下文。
示例:
> runas /profile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""
注意:
仅在出现提示时输入用户密码。
注意:
USER @ DOMAIN与/ netonly不兼容。
Windows Vista and later syntax
RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]         /user:program
RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]         /smartcard [/user:] program
RUNAS /trustlevel:program
/noprofile Specifies that the user's profile should not be loaded, which allows the application to load more quickly, but can cause some applications to malfunction.
/profile The default setting that specifies that the user's profile should be loaded.
/env Use the current environment instead of the user's.
/netonly Use if the credentials specified are for remote access only.
/savecred Use credentials previously saved by the user.
/smartcard Use if the credentials are to be supplied from a smartcard.
/user should be in form USER@DOMAIN or DOMAIN\USER
/showtrustlevels Displays the trust levels that can be used as arguments to /trustlevel.
/trustlevel should be one of the levels enumerated in /showtrustlevels.
program Command line for EXE. See below for examples.
Examples
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""
Note

Enter a user's password only when prompted.

Note

The switch /profile is not compatible with /netonly.

Note

The switch /savecred is not compatible with /smartcard.

Windows XP and earlier syntax
RUNAS [/profile] [/env] [/netonly] /user:program
/profile Use if the user's profile needs to be loaded.
/env Use the current environment instead of user's.
/netonly Use if the credentials specified are for remote access only.
/user should be in form USER@DOMAIN or DOMAIN\USER.
program Command line for EXE. See below for examples.
Examples
> runas /profile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""
Note

Enter user's password only when prompted.

Note

USER@DOMAIN is not compatible with /netonly.

查看英文版

查看中文版

runas 示例

有关此命令的示例,请参阅Microsoft的上述示例。
See Microsoft's above examples for examples of this command.

查看英文版

查看中文版