Example:
C:\spawn\serverdoc.exe C:\half-life\hlds.exe +maxplayers 32 -game cstrike +port 27015 -nojoy -noipx -heapsize 250000 +map cs_italy +servercfgfile server.cfg +lservercfgfile +mapcyclefile mapcycle.txt +motdfile motd.txt +logsdir logs -zone 2048
here's the items in detail:
C:\serverdoc\serverdoc.exe - I use server doc to keep the server running. if the server crashes, serverdoc will automatically restart it
C:\half-life\hlds.exe - this is the path and filename of hlds, the Half-Life dedicated server
and the HLDS options can be in any order:
+maxplayers 32 - the max players for the server
-game cstrike - the mod to use
+port 27015 - the port to use
-nojoy - turn off joystick support on the server (clients can use joysticks - this maybe just makes the cpu footprint a tiny bit smaller because it won't listen on the joystick port)
-noipx - turn off NetWare IPX support (not necessary unless playing on a NetWare LAN)
-heapsize 250000 - use 250 MB RAM (if you have that much - it doesn't seem to need more)
+map cs_italy - the map to start on (pick a good one! it will be the most common map)
+servercfgfile server.cfg - the name of the server.cfg file
+lservercfgfile - not used for a dedicated server
+mapcyclefile mapcycle.txt - the name of the map list file
+motdfile motd.txt - the name of the message of the day file
+logsdir logs - the name of the log directory
-zone 2048 - i think this causes it not to crash when it gets a long console line? not sure