Run SHOUTcast as a Windows Service

You can run SHOUTcast as a Windows Service, so that you can log off on your server and still run SHOUTcast. This is done with a utility called SRVANY.EXE. This utility runs as it’s own service and when it starts it starts SHOUTcast with it. Pretty simple stuff really, so here goes.

Installation:

  1. Install SHOUTcast server as normal to the C:\Program Files\SHOUTcast directory
  2. Copy instsrv.exe to your C:\WINDOWS\system32 directory
  3. Copy SRVANY.EXE to C:\Program Files\SHOUTcast
  4. From command prompt, run this command – INSTSRV SHOUTcast “C:\Program Files\SHOUTcast\srvany.exe”
  5. Run the Registry Editor (REGEDT32.EXE)
  6. Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SHOUTcast: create a ‘Parameters‘ key (folder)
  7. Under the this key, create a REG_SZ string value called Application and add in this data C:\Program Files\SHOUTcast\sc_serv.exe
  8. Configure the SHOUTcast .ini file C:\Program Files\SHOUTcast\sc_serv.ini
  9. Close Regedit, then open the services console in administrative tools, or start, run, services.msc, confirm it is set to start Automatically and the logon account is LocalSystem. Then click the Allow Service to Interact with Desktop
  10. Start the service, check in Task Manager, you will see sc_serv.exe in there, and if you stop the service then sc_serv.exe will disappear.

Update April, 2020 – Or you can just run the below PowerShell script:


# Download the latest copy of SHOUTcast
$url = 'http://download.nullsoft.com/shoutcast/tools/sc_serv2_win64-latest.exe'
$exeoutput = "$env:TEMP\sc_serv2_win64-latest.exe"
Invoke-WebRequest Uri $url OutFile $exeoutput
# Setup SHOUTcast silently
$arguments = '/S'
Start-Process $exeoutput ArgumentList $arguments Wait
# Copy the SHOUTcast Config file
$url = 'https://ejukebox03.blob.core.windows.net/shoutcastcontainer/sc_serv.conf'
$confoutput = "$env:ProgramFiles\SHOUTcast\sc_serv.conf"
Invoke-WebRequest Uri $url OutFile $confoutput
# Register the SHOUTcast service
$proc = "$env:ProgramFiles\SHOUTcast\sc_serv.exe"
$arguments = 'install Shoutcast sc_serv.conf'
Start-Process $proc ArgumentList $arguments Wait
# Start the SHOUTcast service
Start-Service 'SHOUTcast'
Set-Service Name 'SHOUTcast' StartupType Automatic
# Allow SHOTcast through Windows Firewall
New-NetFirewallRule DisplayName "Allow SHOUTcast" Direction Inbound Program "$proc" Action Allow

An example sc_serv.conf file?


adminpassword=AdminPassword
publicserver=never
requirestreamconfigs=1
logfile=logs\sc_serv.log
w3clog=logs\sc_w3c.log
banfile=control\sc_serv.ban
ripfile=control\sc_serv.rip
portbase=8000
;Stream IDs
; Connect like this as the password: Password:#1633
;Test
streamid_1=1
;Player 1
streamid_2=001
;Player 2
streamid_3=002
;Stream Paths
streampath_1=/zero
streampath_001=/one
streampath_002=/two
;Stream Passwords
password_1=Passw0rd
password_001=Passw0rd
password_002=Passw0rd
;streamauthhash_1=tWbo4BLct4FX5lOF1geL
;Specify whether the buffer size is fixed [0] or adaptive [1] [Default = 0]
buffertype = 1

view raw

sc_serv.conf

hosted with ❤ by GitHub

2 Comments

  1. Thanks much for the good information.

    Modified registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SHOUTcast\Parameters\Application. Added config file to load when sc_serv.exe is started.

    Example: C:\Program Files\Shoutcast\sc_serv.exe sc_serv_public.conf

    Correct config file for my server is started automatically.
    Didn’t use sc_serv.ini.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s