closing application window on powershell

Hello All,

I have this bit of code that opens a self made application and presses return.
I want to then close the application but I cannot get it to close. This is my code. Anyone help? Thanks.


$wshell = New-Object -ComObject;

Sleep 3



I would change line 1 to:

$proc = Start-Process -FilePath "C:\Users\App.exe" -PassThru

Then when you are done with your SendKeys you can:



yes. perfect. Thanks very much :slight_smile: