Open Peter82kr opened 3 years ago
Should work but I don't know, haven't tried it. Your best chance would be starting the .bat-file
Googling "run bat script as a service" shows several solutions, e.g. stackoverflow or AlwaysUp AlwaysUp2 (will cost you 50$)
Please report back if it works or not, could be good to include on the wiki.
Used iexpress.exe built in windows server 2019 to convert batch file to exe. Then used this: https://nssm.cc/ to setu up exe as system service. Service is set with delayed start to prevent any lag or slowdowns., and set to not display any windows or consoles.Also set with high priority. Succesfully run csgo server w/o loging into windows server 2019 im using desktop expierience server. Now i have question. Before that steps i set server to reboot at 6 am and update during restart. It will work same when batch command are run w/o starting csgosl? Im currently using standalone-server-start.bat converted to exe but i dont know do it will reboot srcds and update.
Thanks for describing your solution! Regarding: " i set server to reboot at 6 am and update during restart." I assume you mean you have used the csgosl "Restart server options" and set it to restart at 6 am? That requires csgosl to be running and controlling the restart. Guess that's not what you want since you want to run the server regardless of if you're logged in or not (and is running csgosl). I would suggest restarting the windows service instead at a certain time (6 am) and when it restarts it will perform the update as well (since that is part of the standalone-server-start.bat script if you enabled the standaloneupdate option). I would also think not converting the bat-file to an exe would make it easier to maintain if you change options in csgosl. csgosl will automatically update the standalone-server-start.bat script but the conversion to exe will not take place.
... to prevent closing after user log off on windows? Is it possible?