An app I want to push to various systems (Notepad++) doesn't generate it's configuration file until after it starts, so I'd like to start the application quickly hidden in the background so that the config.xml
is generated (grabbing the apps PID as it is starting), then kill the app a second later. I thought I could do this as follows:
Start-Process -WindowStyle Hidden -FilePath "C:\Program Files\Notepad++\notepad++.exe
But this does not work and the app opens normally. How can I start this app hidden in the background? Also, how can I get the PID as it is starting so that I can kill it shortly afterwards?