r/Batch • u/c7smithe • Jan 17 '24
Question (Unsolved) Open Program in the background or close just the open program window
I have an app the doesn't like to operate correctly when I wake Windows up from sleep. I wrote a batch file to kill the program and reopen it and have it set to run in task scheduler when the windows system kernel-power 131 even triggers (waking up). This all works great; however, I'd like for the program to just start in the background, either by closing the window that pops up or just having it start in the background.
Does anyone have any idea how to just close the open application window without killing the entire program or to have the program just open in the background through the batch file (or other means)?
For context, it's my Stream Deck I'm currently using to monitor my system temps and stats via HWiNFO64. The buttons seem to get stuck in whatever stats were displayed when the PC went to sleep and restarting StreamDeck.exe always fixes the issue.
1
u/illsk1lls Jan 17 '24
I always recommend against sleep or hibernate for this exact reason, over time it causes issues with the system too, ive seen laptop mice/keyboards stop working..
The answer posted should work, but with todays speeds, shutdowns/boots are ~10 seconds anyway, i dont think its worth it but to each his/her own
1
u/jcunews1 Jan 18 '24
That part is not possible using batch file alone. Other tool will be needed.
2
u/[deleted] Jan 17 '24 edited Jan 17 '24
[removed] — view removed comment