It cannot work with RP_ADMIN=1 as it has to use a completely different mechanism. (as in, while you can set RP_ADMIN to 1 it will have no effect when using RP_CAPTURESTDOUT). There are likely lots of other caveats we have yet to discover and I suspect I will regret adding this command in about, oh, 20 minutes.Grovkillen wrote: ↑Wed Jun 07, 2023 4:02 pmCan someone confirm that this is working with RP_ADMIN=1?
[added 15.0.23] Run command, capture STDOUT
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7369
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7369
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
In any case, if you're not admin, and you start something as admin, then you won't have permission to interact with or access that process, so you won't be able to read its STDOUT. Makes no sense. Hence you can't use RP_ADMIN here.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Grovkillen
- Automation Wizard
- Posts: 940
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
Understood, and no need to regret it. If it's documented it's all good 

- Grovkillen
- Automation Wizard
- Posts: 940
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
My code did work I just added it as a information for others that use the CAPTURESTDOUT. And sometimes you need to terminate the cmd.exe by using the /c switch. I love this feature and are testing it like a mad man to see how it behavesJRL wrote: ↑Wed Jun 07, 2023 4:15 pmThis works for me:
(Note the use of "Between>" rather than "RegEx>")
Looks like your file is on a shared drive, be sure your admin user has access to the share.
Code: Select all
Let>PATH_TO_FILE=L:\A\Run MyTime.exe Let>RP_WINDOWMODE=0 Let>RP_CAPTURESTDOUT=1 Let>RP_Admin=1 Let>CMD_TO_RUN=cmd /c certutil -hashfile "%PATH_TO_FILE%" MD5 RunProgram>CMD_TO_RUN Between>RP_STDOUT,:%crlf%,%crlf%Cert,HASH_OF_FILE,Match_Num MDL>HASH_OF_FILE_1

- Grovkillen
- Automation Wizard
- Posts: 940
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
Maybe just add this to the help:
RP_CAPTURESTDOUT=1 will allow for a capture of the output from a cmd command but beware that you cannot use this together with RP_ADMIN=1 (if set to 1 it will be ignored when RP_CAPTURESTDOUT=1). Also be aware that some commands will output in sessions meaning that not everything might be capture by the RP_CAPTURESTDOUT=1, in that case you should use either a pipe to clipboard or direct the output to an external file. In some cases it will be of help to use the "cmd /c" switch to force the command to terminate and reveal an output. It's a test by case type of deal.
- Grovkillen
- Automation Wizard
- Posts: 940
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
Is this RP_STDOUT variable fetched from a temp file in local data? If so, it needs to be unique (name) because if multiple applications use the capture at the same time the exact same issue as with using clipboard will arise.
- Grovkillen
- Automation Wizard
- Posts: 940
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
Marcus, is my observation true? Can this be a problem?
- Marcus Tettmar
- Site Admin
- Posts: 7369
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
Nothing is shared. There shouldn't be a clash.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Grovkillen
- Automation Wizard
- Posts: 940
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: [added 15.0.23] Run command, capture STDOUT
Ok, thanks for the information. Then my findings must be caused by something else but at least I can rule this thesis out of the equation 
