Hi!
I'm looking to know how to close the cmd.exe with a bat file because I'm trying to make a script to apply a schedule on my server.
I know there is kill taskkill command but I've two cmd.exe running and I don't want to close all app.
Nothing similar to:
Code:@echo off cls :startRustDedicated.exe -batchmode +server.port blablabla@echo. @echo Restarting server... @echo. goto start
but for closing the server?
Thanks!
Solved How to close cmd.exe with bat file?
Discussion in 'Rust Development' started by Shelby, Jan 9, 2016.
-
Wulf Community Admin
The only way you'd be able to close that script is to click the X in the corner of the window. The looping will keep restarting otherwise. You'll have to script in other checks if you don't want it to reboot, such as time checks, but other than that there isn't much.
-
Thanks for your answer! -
Does the cmd.exe 'start' have the ability to output a pid file?
If so, you can use that with taskkill
Not at home currently, so I can't check for you. -
Tadaaa!
I find a solution!
I've just created a macro like this:
- Active Windows: your cmd.exe server window
- Insert text: say Fermeture du serveur imminent!
- Insert action: (ENTER)
- Delay: 10s.
- Insert text: save
- Insert action: (ENTER)
- Delay: 10s.
- Windows Close: your cmd.exe server window
Macro is activated every day at xx:xx PM.
This simple solution allow me to create a scheduled server like I wanted.
Thanks again for your answers!