Topic: [Guide] How to set the server on startup in windows
In my case I'm using Windows 2012 server and I was forced to manually connect everytime to start the server via RDP so I made a script to do this.
Install autologon
Link: https://docs.microsoft.com/en-us/sysint … /autologon
Set your username and password with the tool to log in automatically when windows starts.(user Administrator in my case)
Run this command in cmd under administrator access.
%SystemRoot%\System32\reg.exe add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v "Diablo II Server" /d "\"C:\Users\Administrator\Desktop\Startup\d2server.bat\""
Modify the path according to your needs.
Next, create a folder on your desktop called Startup and create a shortcut for PvPGN.exe, d2cs.exe, d2dbs.exe, D2GS.exe and put them all toghether in the Startup folder.
Now, create a file called d2server.bat and paste the next following code:
@echo off
title Diablo II Server Startup
:: Set the Startup folder path directory.
set root=C:\Users\Administrator\Desktop\Startup
if "%root:~-1%"=="\" ( set root=%root:~0,-1% )
echo Sleep for 5 minutes...
ping 127.0.0.1 -n 301 > nul
echo Run PvPGN
start "" "%root%\PvPGN.lnk"
ping 127.0.0.1 -n 6 > nul
echo Run d2cs
start "" /min "%root%\d2cs.lnk"
ping 127.0.0.1 -n 6 > nul
echo Run d2dbs
start "" /min "%root%\d2dbs.lnk"
ping 127.0.0.1 -n 6 > nul
echo Run D2GS
start "" "%root%\D2GS.lnk"
ping 127.0.0.1 -n 6 > nul
The script will sleep for 5 minutes after the windows boots up, but you can delete those lines. in my case if I have a power loss, the server will boot faster than the router will sync with the ISP and the PvPGN server will not translate the ip address correctly.
Last step, set in your BIOS to power on the machine if is a power loss which means you are not forced to press the button to turn on the machine so if there is a power loss and the machine gets power it will automatically turn on.