Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
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 '12 at 10:40
1  
This is a question that just begs an RTFM answer. –  John Gardeniers Aug 10 '12 at 12:15
    
@JohnGardeniers And got 2 upvotes instead. :/ –  HopelessN00b Aug 10 '12 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. –  Harry Johnston Aug 11 '12 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 '12 at 20:44

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
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 '12 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 '12 at 18:16
1  
@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. –  Harry Johnston Aug 11 '12 at 8:57

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)

share|improve this answer
    
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 '12 at 18:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.