1

Some application after closing save some data into its .ini-file. When I use

Stop-Process -Name applictin_name

it closing app, but state does not save into .ini

Ho can I correctly close the application with powershell?

Sergio
  • 313
  • 5
  • 18

1 Answers1

0

It's just a shame it doesn't work in combination with the if keyword.

$running = Get-Process prog -ErrorAction SilentlyContinue

if (!$Running){ 
   Get-Process virtualdj |  Foreach-Object { $_.CloseMainWindow() | Out-Null }
}
codewario
  • 19,553
  • 20
  • 90
  • 159