Open admattingly opened 8 months ago
If you do vdesk run -o 1 C:\Windows\System32\cmd.exe
it's the expected behavior that after the command is succesfully finshed, the cmd window is still open.
Maybe vdesk open
will be a better command name.
I strongly disagree. The only reason cmd.exe hangs around is because this is the default behaviour of cmd.exe. If you run cmd.exe with the /C option, it terminates after running whatever command you specify after the /C.
I think the behaviour of vdesk should be to open a console application on the specified desktop and remove its console window once the executable terminates.
If this is not acceptable as the default behaviour of vdesk, perhaps an option could be added to invoke this behaviour?
Kind regards
Andrew.
From: Jonathan Hansen @.> Sent: Friday, April 5, 2024 12:25 AM To: LittleVaaty/VDesk @.> Cc: Andrew Mattingly @.>; Author @.> Subject: Re: [LittleVaaty/VDesk] VDesk hangs after command runs in console window (Issue #6)
If you do vdesk run -o 1 C:\Windows\System32\cmd.exe it's the expected behavior that after the command is succesfully finshed, the cmd window is still open. Maybe vdesk open will be a better command name.
— Reply to this email directly, view it on GitHub https://github.com/LittleVaaty/VDesk/issues/6#issuecomment-2037218565 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2P52YGVNTVPNUQHYIUL5DY3VIEDAVCNFSM6AAAAABFN22WH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZXGIYTQNJWGU . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AD2P524LVPASQAMKCH6YBY3Y3VIEDA5CNFSM6AAAAABFN22WH2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTZNV6QK.gif Message ID: @. @.> >
If i understand correctly, you want that after any run command, vdesk closes the terminal in which it is executed ?
Yes, once the command/program has completely finished executing and has returned control to its parent (shell), the console window should be closed.
From: Jonathan Hansen @.> Sent: Friday, April 5, 2024 8:47 PM To: LittleVaaty/VDesk @.> Cc: Andrew Mattingly @.>; Author @.> Subject: Re: [LittleVaaty/VDesk] VDesk hangs after command runs in console window (Issue #6)
If i understand correctly, you wan that after any run command, vdesk closes the shell in which it is executed ?
— Reply to this email directly, view it on GitHub https://github.com/LittleVaaty/VDesk/issues/6#issuecomment-2039361009 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2P52ZE6B2TIKNASC66JDDY3ZXKFAVCNFSM6AAAAABFN22WH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZZGM3DCMBQHE . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AD2P526ZYEXOADBTORV6S6DY3ZXKFA5CNFSM6AAAAABFN22WH2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTZRYW7C.gif Message ID: @. @.> >
Then what appen when vdesk is executed in a script ? vdesk return the code 0 when success after that it is up to the parent terminal or script to act accordinly. vdesk has no control over the parent process
It would be nice if vdesk reflected the return code from the program it is executing, if possible. This might require an option for vdesk to choose between sending back its return code versus the return code from the called program.
From: Jonathan Hansen @.> Sent: Friday, April 5, 2024 8:59 PM To: LittleVaaty/VDesk @.> Cc: Andrew Mattingly @.>; Author @.> Subject: Re: [LittleVaaty/VDesk] VDesk hangs after command runs in console window (Issue #6)
Then what appen when vdesk is executed in a script ? vdesk return the code 0 when success after that it is up to the parent terminal or script to act accordinly. vdesk has no control over the parent process
— Reply to this email directly, view it on GitHub https://github.com/LittleVaaty/VDesk/issues/6#issuecomment-2039383594 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2P522BV6CJKSUIRIXXZFLY3ZYWDAVCNFSM6AAAAABFN22WH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZZGM4DGNJZGQ . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AD2P525QVKHJOQN2XP54B2DY3ZYWDA5CNFSM6AAAAABFN22WH2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTZR2DCU.gif Message ID: @. @.> >
Just to add context: I am pretty sure that the original VDesk didn't block that way. But this is just a design decision. Currently appropriate usage is probably using start
like in the sample.bat of the project if you want a similar behaviour. I use that as well.
Just to add my context: I’m effectively running a script where each step needs to complete before initiating the next step. Each step involves running a console program which pops up in its own window, for seconds/minutes. I can’t use start, as this returns to the script immediately. I was hoping to use VDesk to make the console windows pop up in another desktop, so they are less of a nuisance. I can’t control these console windows to force them to run minimised.
Kind regards
Andrew Mattingly
M: +61 411 263 441
E: @.> @.
R: VK2GCO
From: DoS007 @.> Sent: Thursday, May 2, 2024 1:44 AM To: LittleVaaty/VDesk @.> Cc: Andrew Mattingly @.>; Author @.> Subject: Re: [LittleVaaty/VDesk] VDesk hangs after command runs in console window (Issue #6)
Just to add context: I am pretty sure that the original VDesk didn't block that way. But this is just a design decision. Currently appropriate usage is probably using start like in the sample.bat of the project if you want a similar behaviour. I use that as well.
— Reply to this email directly, view it on GitHub https://github.com/LittleVaaty/VDesk/issues/6#issuecomment-2088655933 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2P524C7HNODRKIJQ6GBALZAEETPAVCNFSM6AAAAABFN22WH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGY2TKOJTGM . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AD2P522ZMCGV44CDKREZXNDZAEETPA5CNFSM6AAAAABFN22WH2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT4PZOD2.gif Message ID: @. @.> >
You could use for hiding the /MIN
Option of start
. You can also use the Task Scheduler for autostarting and then choose the option hidden
. This might even hide the plop in the status/task bar.
Edit: Just noticed that the first one isn't an option for you.
vdesk will just start the scipt but will not wait the end of execution of the script. I'm not familiar with batch, but if powershell is an option, Start-Process has an 'wait' option that will do what you want.
Edit: I will look to add an parameters that wait the end of the child process.
I can’t use start, as I said, because it returns control immediately and I need my calling script to suspend until the console program completes.Sent from my iPhoneOn 3 May 2024, at 1:02 AM, Jonathan Hansen @.***> wrote: vdesk will just start the scipt but will not wait the end of execution of the script. I'm not familiar with batch, but if powershell is an option, Start-Process has an 'wait' option that will do what you want.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@admattingly You probably didn't getmy Edit-Update via E-Mail. But for your case, you should really try the Windows Task Scheduler with the hidden Option.
If I use VDesk to "run" a console command, the C:\Windows\System32\cmd.exe window does not close once the command completes (successful) execution -it just sits there until I manually close the window. This is happening on Windows 11.