Quantcast
Viewing all articles
Browse latest Browse all 11372

Powershell to close a running program gracefully without use's interact

I have this powershell code to close a program gracefully

Get-Process MyProgram |   Foreach-Object { $_.CloseMainWindow() | Out-Null }

the problem is that it will pop-up a Windows asking user to hit 'OK' or to 'Cancel'! what powershell code I can force it selects OK and not prompts for user to interact? thanks.


Thang Mo


Viewing all articles
Browse latest Browse all 11372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>