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
  • 291
  • 5
  • 13

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 }
}
Bender the Greatest
  • 17,062
  • 18
  • 82
  • 145