2

runas is already installed on many systems (maybe by default) psexec is shipped with the awesome PsTools.

Why would I use psexec (an external tool) instead of runas(an included tool) ?

What are the differences between them?

9
  • 2
    Yes, runas is provided by default with Windows. The main difference is runas will only work locally, while psexec was designed to work with remote computers.
    – jscott
    Aug 10, 2012 at 10:40
  • 1
    This is a question that just begs an RTFM answer. Aug 10, 2012 at 12:15
  • @JohnGardeniers And got 2 upvotes instead. :/ Aug 10, 2012 at 23:11
  • One additional trick psexec can do (and runas can't) is to run a program in local system context. There are some things that are easier to do as local system than as administrator. Aug 11, 2012 at 8:59
  • @JohnGardeniers Don't see the reason why asking a legit question, related to servers in Q&A site for servers would beg for RTFM. I read the manual before, just that coming from *nix where after @ a remote host can be specified (ssh for example), got confused with the syntax USER@DOMAIN of runas assuming that specifying a remote domain was possible, so I thought that runas could execute commands in remote machines as psexec or ssh.
    – user454322
    Aug 25, 2012 at 20:44

2 Answers 2

1

Of course psexec is no longer an external tool - SysInternals is now part of Microsoft (since 2006, I believe)

From Mark Russinovitch:

Many Windows administrative console tools can run only on a local machine. PsExec lets you remote-enable any of them.

Have a good look through the psexec page here.

3
  • Thank you for the answer. Does this mean that there is no such thing as runas /env /user:jdoe@remote_domain.com? Where remote_domain.com refers to a "non-local domain" I already knew the article.
    – user454322
    Aug 10, 2012 at 18:00
  • I was aware that SysInternals is now part of Microsoft, with "external" I meant that psexec is not installed by default.
    – user454322
    Aug 10, 2012 at 18:16
  • 3
    @user454322: runas can handle a domain user account, but the program you're starting is still going to run on the local computer and on the current desktop. Psexec is normally used when you want to make a program run on another computer, or sometimes when you want to make it run on the local computer but in a different session. Aug 11, 2012 at 8:57
1

One of the most important features of psexec (at least for me):
fully detach child from parent
it closes all parent inherited file descriptors (as opposite to start)

1
  • Interesting... Assuming the following command is ran from cmd, runas /env /user:jdoe@mydomain program would program be able to access the file descriptors of cmd? Any documentation/reference?
    – user454322
    Aug 10, 2012 at 18:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .