Shell execute & shell execute (advanced)

Ahoy there,

Quick question, i’m sorry, i searched but didn’t find the answer anywhere:

So i want to execute a commandline tool and need to get the output.
With [shell execute](shell execute)the program is running fine but the output isn’t what i’m looking for.

With [shell execute (advanced)](shell execute (advanced)) the ouput seems fine, but the program instantly closes.
I read in the helppatch that you can enable a parallel mode but didn’t figure out how.

So maybe someone can enlighten me?

Cheers,
Gorg

can you upload your patch?

No patches, i just used the help patches yet. The tool i use is Pronsole (for sending GCode to 3d Printer), but it behaves the same way with the standard windows .cmd.

With shell execute (advanced) it is that when i hit execute the cmd.exe (or ping.exe)executes the command but then afterwards closes the application, i want to leave it open and enter more commands.

With the standard shell execude node cmd.exe keeps running, but unfortunatly the output is not enough.

I read in the hepfile there is some sort of parallel mode, maybe that is what i need, but i can’t figure out how to enable it.

Hope that explains my issue better.

Better to execute command via cmd, so if Pronsole can be runned from cmd, you should run it via “cmd /c Pronsole.exe”

@alg: thanks for your response, but that’s not the issue (if i understand you correctly)

Here i made a patch to better illustrate my Problem

demo.v4p (13.1 kB)

hi Gorg, i’m not shure the shellexecute closes the application as you say, but seems that dosen’t display the things only (but all is running).
i’ve attached your same patch, but with a gdi renderer to see better the output.
if you hit the bang button to execute, and the you write a dos command (for example “dir”), you can see that what you should see in the console window is displayed on the output of the shellexecute node, but it works. i mean, the shell is empty but is working (at least here).

demo_2.v4p (13.9 kB)

hmmm… does the window stay open for you? Or is the Program still running? Because the IsRunning and Completed Pins indicate that the Program instantly finishes. I researched a littel to see if it’s maybe only my computer (have no other machine to try it out until evening), found that with the /d flag you prevent cmd.exe from automaticly closing. But that didn’t help.

Hey Gorg,

I made some changes to shellExecute (advanced) as a new plugin called ShellExecuteAdv, try this one from the help patch I did and tell me if it is working? The /k argument is important to keep the cmd.exe which is running in parallel mode, unless you check the block until finished pin.

…and one more thing: there are two new input pin:

_input _- string (where you can put any command you want to execute after the window is open and the first command is executed - specified in the arguments)

Send Input - Bang, sends the Input to the running program

… so no need for keyboard hacking ;)

good luck!

ShellExecuteAdv + help patch (355.3 kB)

Woooooohooooo!!!

cmd.exe now works as i imagined, thank you so much, also for the 2 new pins!

Although I couldn’t get pronsole.exe to run yet, also not through starting it through cmd.exe (start /b \bla\bla\pronsole.exe).
or maybe it runs already, because i see some minor error messages from pronsole in the error pin, maybe the stdoutput is a bit mixed up.
Also vvvv crashes if it is left alone for a while :)

i will test further…

but thanks again for the time, this is why this community rocks!

from where I can download pronsole.exe, I could not find a reliable source? So I can test ;) as well

//EDIT 1
OK, I found it inside the https://github.com/kliment/Printrun

at the link for windows: http://koti.kapsi.fi/~kliment/printrun/

//EDIT 2
the thing is that the stdout buffer of the pronsole.exe does not flush after I send a command… only when I send exit, I get all the output, but this does not mean that it does not receive the commands, may be you can try.
I am executing directly the pronsole.exe program with out any parameters and then I send different commands via input/send input (like help, reset, exit,…)

//EDIT 3
Ok, the output (stdout) of your program (pronsole.exe) is buffered for sure - so you won’t get anything till that buffer is filled, or the pronsole.exe exits.

if you send, let’s say “help” command, many times, eventually you get the output, so the things work, but the output of the pronsole.exe will lag.

hope that helps

cheers
and
good luck!

Okay, that’s not good to hear but i’m glad that you helped me out clearing things, really man, i appreciate it!
Seems like i have to come up with something else :)

cheers

Gorg

well, the Printrun is open source, may be something there can be changed, so does not buffer so much the output, the rest is OK ;)

all the best

Okay, i just wanted to tell you that pronsole.exe when conneted to the printer flushes it’s stdout as expected, so now everything is working as best as it can :) Thank you again for effort, you really were a livesaver here!

mfGorg

yes, only when we redirect the output the lag occurs
u r welcomed

all the best