Hi,
Quick question, if I run my Powershell Studio Project exe and close it, I can see in processes that it is still running.
Can't alt + tab to it, but the process(es) is(are) still here.
Something I can do about this?
Please advise.
S.
Exe running several times in background, even when closed
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Exe running several times in background, even when closed
.Net processes can take a few seconds to close down. It is is longer than that you leave resources open. Make sure you exit loops, close jobs, close files and close forms.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Exe running several times in background, even when closed
Thanks Alexander, strange thing is that it is only on Windows 2016, not on Windows 2012 server.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Exe running several times in background, even when closed
I don't know your code, so its not possible to tell
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Exe running several times in background, even when closed
There is nothing special to it, I close the project with the x of the form. It closes correctly on Windows 2012, not on 2016.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Exe running several times in background, even when closed
Probably loading a different version of a module and the newer version is not terminating unless you kick it out with Remove-Module
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Exe running several times in background, even when closed
Are you using PSUtils?
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Exe running several times in background, even when closed
Windows 2010 and later do not necessarily remove a process from memory. Since W10 processes can remain dormant in memory even after they are close. All "Store" apps will stay in memory after they are closed. Non-store apps can also stay in memory.
I have not yet been able to track down the rules that govern this. Edge will remain in memory always after first execution. IE will stay in memory if certain COM objects have been activated. It is not clear if this is intended or some side-effect of the COM objects being used.
If you are using Excel or other Office apps via COM then this can cause your app to remain in memory.
This behavior is new to W10 and later systems.
There may be other causes of this behavior.
I have not yet been able to track down the rules that govern this. Edge will remain in memory always after first execution. IE will stay in memory if certain COM objects have been activated. It is not clear if this is intended or some side-effect of the COM objects being used.
If you are using Excel or other Office apps via COM then this can cause your app to remain in memory.
This behavior is new to W10 and later systems.
There may be other causes of this behavior.
Re: Exe running several times in background, even when closed
Thanks for the update. That could explain things.
Note not related to this question: why are my other posts "locked" again -had this in the past also-?
Wanted to update my post on jobargs (can't open the example you posted, get message "Test-JobArgs.psf: Unable to load Test-JobArgs.psf (File Format: v3.1), because it was created with a different version of SAPIEN PowerShell Studio 2017") ... but it is locked.
Note not related to this question: why are my other posts "locked" again -had this in the past also-?
Wanted to update my post on jobargs (can't open the example you posted, get message "Test-JobArgs.psf: Unable to load Test-JobArgs.psf (File Format: v3.1), because it was created with a different version of SAPIEN PowerShell Studio 2017") ... but it is locked.