VDesk icon indicating copy to clipboard operation
VDesk copied to clipboard

Enhancement proposal: add "wait" option

Open GitMensch opened this issue 6 years ago • 3 comments

I'd like to use vdesk as command runner allowing sub-programs (1-100 per minute...) to start in a specific desktop. Currently this isn't possible because vdesk starts a detached process and after moving it to the specified desktop does a shutdown, exiting and returning zero.

Upon wait:true the process to run would not start detached (vdesk will keep running) and after the process to run finishes vdesk would query its returning value and returns itself with the same value.

GitMensch avatar Sep 27 '18 07:09 GitMensch

Would a batch file work for you:

echo off echo starting vdesk programs vdesk on:2 run:"C:\program1.exe" timeout 1 vdesk on:3 run:"C:\program2.exe" timeout 1 vdesk on:4 run:"C:\program3.exe" timeout 1

If not, can you explain your use-case?

appendages avatar Dec 22 '18 21:12 appendages

A batch file would work for me if vdesk would wait.

The use-case is that I need the exit code from the program specified by run: not the "zero" from vdesk and that I need vdesk to end when the actual process is finished.

Currently program1 starts program2 with some parameters, waits until program2 returns and, depending on the return code does something, then starts program2 with some other parameters, waits until program2 returns .... Program2 sometimes lasts 5 minutes, sometimes only 2 seconds. I've adjusted program1 to start vdesk run:program2 instead but had to revert it because program1 now always gets a return code of zero nearly immediately and spawns many instances of program2 (as it was told the previous instance is already finished).

I guess that explanation helps, doesn't it?

GitMensch avatar Dec 22 '18 22:12 GitMensch

Ah ok, so its depending on a process ending for the next iteration and/or change to start. Although I can't help you, I appreciate you explaining it in more detail. It's always fun to see peoples creativity.

appendages avatar Dec 22 '18 23:12 appendages