Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

runas

From Wikipedia, the free encyclopedia
Command on Windows to run a program as another user
runas
Developer(s)Microsoft
Initial releaseFebruary 17, 2000; 25 years ago (2000-02-17)
Operating systemMicrosoft Windows
TypeCommand
LicenseProprietarycommercial software
Websitedocs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc771525(v=ws.11)

Incomputing,runas (a compound word, from “run as”) is acommand in theMicrosoft Windows line ofoperating systems that allows a user to run specific tools and programs under a differentusername to the one that was used tologon to a computer interactively.[1] It is similar to theUnix commandssudo andsu, but the Unix commands generally require prior configuration by the system administrator to work for a particular user and/or command.

Microsoft Windows

[edit]

Therunas command was introduced with theWindows 2000 operating system.[2] Any application can use this API to create aprocess with alternate credentials, for example,Windows Explorer inWindows 7 allows an application to be started under a different account if the shift key is held while right clicking itsicon. The program has the ability to cache verified credentials so that the user only ever has to enter them once.

Syntax

[edit]

The command-syntax is:[3]

runas [{/profile | /noprofile}] [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel:<TrustLevel>] [/savecred] /user:<UserAccountName> program

Parameters

[edit]

This section is paraphrased from therunas /? command.

  • /noprofile: Speeds up the loading of the application by skipping the loading of the user's profile.Note that this might not speed up every application.
  • /profile: Do not skip loading the user's profile.This is the default setting.
  • /env: Use the actual environment, not the user's.
  • /netonly: Specifies that the given credentials are to be used for Remote access only.
  • /savecred: Credentials saved by the previous user.This setting is not available on Windows 7 Home or Windows 7 Starter Edition. This setting is left out from Windows XP Home Edition as well.
  • /smartcard: Specifies that the credentials will be supplied from a smartcard.
  • /user: Format is eitherUSER@DOMAIN orDOMAIN\USER.
  • /showtrustlevels: Shows help (list of usable trust level parameters) for the /trustlevel switch.
  • /trustlevel: One of the trust levels listed by the /showtrustlevels switch.
  • program: Command line for the executable file.See examples below.

Note: Only type in the user's password, when the system asks for it.

Note: The/profile switch is not compatible with the/netonly switch.

Note: The/savecred and the/smartcard switches may not be used together.

Examples

[edit]
runas /noprofile /user:machine\administrator cmdrunas /profile /env /user:domain\admin"mmc%windir%\system32\dsa.msc"runas /user:user@domain.example.org"notepad C:\filename.txt"runas /user:administrator /savecred"shutdown /i"

Inferno

[edit]

The command is also included in theInferno operating system.[4]

Syntax

[edit]

runas writes theuser to/dev/user and invokescmd with the givenarguments.

runas user cmd [arg...]

Note: The command is only invoked if setting of the username succeeds.

See also

[edit]

References

[edit]
  1. ^"Runas".learn.microsoft.com. 2009-09-11. Retrieved2024-07-04.
  2. ^"MS-DOS and Windows command line runas command".computerhope.com. Retrieved2024-07-04.
  3. ^"Runas - Run under a different user account - Windows CMD - SS64.com".ss64.com. Retrieved2024-07-04.
  4. ^"Inferno's RUNAS(1 )".

Further reading

[edit]

External links

[edit]
Wikibooks has a book on the topic of:Guide to Windows Commands
Ecosystem
Interpreters
Terminals
File system navigation
File management
Archiving
Disk management
Processes
Registry
User environment
File contents
Scripting
Networking
Maintenance and care
Boot management
Software development
Miscellaneous
Retrieved from "https://en.wikipedia.org/w/index.php?title=Runas&oldid=1232571159"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp