52

I have a Hudson build script which calls the SysInternals PsExec utility. Normally, when PsExec is run for the first time by a given user it pops up a dialog box asking the user to accept the licence. The build agent runs as a service and I can see that the build gets stuck at PsExec. Process Explorer shows that PsExec is running, so I strongly suspect it's displaying that same prompt, but because it's running non-interactively there is no way to accept the prompt. Is there any way to get around this silly limitation? Running on Windows Server 2008 R2 x64.

3 Answers 3

86

Use the /accepteula command-line switch to accept the licence agreement.

Or set

HKCU\Software\Sysinternals\PsExec\EulaAccepted 

to 1

Caution: if the reg key above is set to 0 (EULA was declined once) then the /accepteula will not work, you have to set the key to 1 manually (or delete it altogether).

5
  • 4
    Great, thank you! /accepteula does the trick. I wonder why it's not documented?
    – EMP
    Mar 1, 2011 at 22:19
  • 1
    Thanks! I needed to get our build server to recycle our application pools after a deployment - I wanted to use psexec to execute appcmd remotely, but it was getting stuck at the license screen. This was perfect!
    – Rob
    Oct 13, 2011 at 16:21
  • 2
    It is documented - It's right at the very top of the GUI when it first displays - I guess Mark wants you to see the EULA at least once.
    – NapkinBob
    May 23, 2013 at 20:28
  • 1
    They didn't add this "feature" until Microsoft bought SysInternals. Dec 14, 2018 at 20:19
  • 1
    Unfortunately the -accepteula or /accepteula command-line options don't work when running Sysinternals programs from Azure's Kudu command-line.
    – Dai
    May 25, 2020 at 5:21
2

-accepteula flag will suppress the display of the license dialog. More options are available here: https://ss64.com/nt/psexec.html

0

It's documented, but you have to use the 2003 version or higher.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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