Page 1 of 1
CLI Standalone App does not quit (Windows)
Posted: Thu Aug 24, 2017 11:35 am
by dbcbos
I have build a standalone App that does not quit after I output something to stdout
It does quit if I do not write to stdout
Any ideas, might be a Windows setting i'm thinking. I did use:
As stated in the dictionary
Re: CLI Standalone App does not quit (Windows)
Posted: Thu Aug 24, 2017 3:29 pm
by bogs
I don't write for Windows, but is it possible you have to exit the shell (stdout) before closing the standalone?
The equivalent of

on Windows.
Re: CLI Standalone App does not quit (Windows)
Posted: Thu Aug 24, 2017 7:06 pm
by jacque
Right, standalones won't quit if there are any open processes, or any pending messages.
Re: CLI Standalone App does not quit (Windows)
Posted: Sat Aug 26, 2017 4:36 am
by bogs
I seem to remember reading somewhere that there was a way to code killing all remaining processes. Boy I hate getting old and senile

Re: CLI Standalone App does not quit (Windows)
Posted: Sat Aug 26, 2017 4:55 am
by jacque
I'm not sure about all processes but you can do them individually with "close process".
Re: CLI Standalone App does not quit (Windows)
Posted: Sat Aug 26, 2017 5:27 am
by bogs
You know, I seem to think it was in one of the many many (did I say many?) articles I've read over the last few months, however, while I can't think of exactly which it was (I'll get back to you on it if I find it again

), I suppose it could have posed closing multiple processes through a repeat loop, one at a time, just to make sure they were all closed. Then it automatically closed the stack when the last process was killed off.
I still think I remember there was one statement that killed them all in one go, but it wasn't recommended. I'll start the trip down memory lane (HAH) tomorrow. Provided I remember...
Re: CLI Standalone App does not quit (Windows)
Posted: Sat Aug 26, 2017 11:49 am
by [-hh]
Which method do you use to write to stdout?
And why is it of a nature that can hang and block the sender?
Anyway:
If you have a process id or process name then you could try
"kill".
This is LC command that works on Mac/Win/linux (see dictionary).
Or on windows try to use directly (via LC's shell)
"taskkill":
https://technet.microsoft.com/de-de/lib ... 91009.aspx
Re: CLI Standalone App does not quit (Windows)
Posted: Sat Aug 26, 2017 6:52 pm
by jacque
I still think I remember there was one statement that killed them all in one go, but it wasn't recommended
I have only seen this:
Code: Select all
repeat for each line x in the openProcesses
close process x
end repeat
Re: CLI Standalone App does not quit (Windows)
Posted: Sat Aug 26, 2017 7:56 pm
by bogs
jacque wrote:I still think I remember there was one statement that killed them all in one go, but it wasn't recommended
I have only seen this:
Code: Select all
repeat for each line x in the openProcesses
close process x
end repeat
Well, I did say it could have been a repeat statement, didn't I?
That does indeed look familiar, and could well be it, and it sure looks safe enough. I was unable to find where I was originally reading it again to this point, so I'd say run with that

always remembering of course, that it does take a little time for each process to actually close if I recall correctly.
Re: CLI Standalone App does not quit (Windows)
Posted: Mon Aug 28, 2017 2:45 am
by ghettocottage
can you just write a little batch script that you launch separately and include that script in your standalone? That would allow your standalone to proceed with whatever while the batch script runs/quits on its own.