Create a text file in notepad in your server where the file resides hlds.exe
Copy this code there:
Close and save the file with the extension. Bat
echo Protecting hlds from crashes...
echo If you want to close srcds and this script, close the hlds window
and type Y depending on your language followed by Enter.
title hlds.com Watchdog
echo (%time%) hlds started.
YOUR SERVER CONFIGURATION (example: START/HIGH /wait hlds.exe +sv_lan 0
-game cstrike -port 27016 +maxplayers 32 +map de_dust2 -noipx -insecure
echo (%time%) WARNING: hlds closed or crashed, restarting.
If the server is "lie", it will automatically restart.