I need to run a bat file before a server starts.
The file is a simple file copy but it wont overwrite the files if the gameserver is running.
So i have the server set to auto restart at 4.30 am in the morning which is when the server is empty.
Was hoping to have the bat file run when the auto restart process does its thing.
I thought I could use the "Run command before server start" option, see image attached, but I wasnt sure how to phrase the execution of a bat file.
The other idea was to set up a schedule on the server and have that run the bat file but I need to get the timing just right.
Any other suggestions?
Running a *.bat file automatically before a server starts
-
- Posts: 3
- Joined: Sat Jul 08, 2017 12:44 am
-
- Site Admin
- Posts: 3617
- Joined: Thu Apr 20, 2006 2:54 pm
- Location: America's Heartland
- Contact:
Re: Running a *.bat file automatically before a server starts
To run a batch file you need to use cmd.exe. Something like
More info on the cmd command is available at https://docs.microsoft.com/en-us/window ... mmands/cmd
Code: Select all
C:\Windows\System32\cmd.exe \c "C:\Path\to\file.bat"
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!