patrix87 / PowerShellGSM

A Comprehensive PowerShell Tool for Simple Automated Game Server Management.
https://github.com/patrix87/PowerShellGSM/
MIT License
109 stars 19 forks source link

Task Scheduler - PowerShell Window Flashing every 5 minutes #41

Closed cbabione closed 8 months ago

cbabione commented 8 months ago

When the task scheduler starts the background task every 5 minutes, there is a quick flash of a window that pops up and is distracting to the user as it can switch window focus. This affects me negatively as I run the server in the background so others can play while I may be doing other things on my computer. I was able to change that behavior by changing the task to "Run whether user is logged on or not" and "Do not store password.". I currently go in and manually change the task settings each time I start the server.

I am not a Windows or PowerShell person (I live on linux servers for work), but I wanted to share this to see if you could incorporate a solution into your scripts. I started using the scripts for ASA and love what you have done!

patrix87 commented 8 months ago

You can't completly hide the command window launched from the task scheduler when the task is launched as the logged in user. You also don't want to launch the server as another user or as an administrator as you will face a lot of other issues. The solution is to run the server on an actual server and not your personnal computer or in a virtual machine like vmware or virtual box.

cbabione commented 8 months ago

Happy New Year! Thanks for responding and thanks for sharing your code. I have been successfully running my server for a while now using your project and the settings I proposed and do not experience issues with the command window popping up. If I need info on the server status or to do an administrative task, I monitor the log files directly or use an rcon client. While I sincerely appreciate your work on this project, I disagree with your opinion that it should not be run on a personal computer that has the resources to do so, or requiring a virtual machine. I do wish you the best and hope you reconsider incorporating this into your scripts.