I wanted to run my Visual Basic program to run as a service so no auto-login was required. I completed the following steps to achieve this goal.
Windows Server 2008 does not come with a set of Resource Kit Tools like Server 2003 did. But I wanted to use the "srvany.exe" from this 2003 kit as I could not accomplish what I wanted using "sc" alone. I downladed the Server 2003 resource kit from here and installed it locally to get "srvany.exe".
Copy "srvany.exe" to a suitable location on your Windows 2008 server. e.g. C:\Windows\System32
Use "sc" to create a new service that launches your local "srvany.exe". e.g. sc create ServiceID binPath= "C:\Windows\System32\srvany.exe DisplayName = "Service Display Name"
Use the Registry Editor (regedit) to navigate to your newly created service "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceID"
Create a Key "Parameters" at this location. This will display as a folder
Create a String within the "Parameters" key. The String reference should be "Application" and the String value should be the full path to your application including the application exe reference (No quotes are required in the string)
If your exe program launches another application such as Microsoft Word you should also complete the following: Navigate to "C:\Windows\SysWOW64\config\Systemprofile". Create a new folder here called "Desktop"
Within Services you may wish to set your new service to start automattically. You can do this within the Service Properties
If you previously had your .exe application running within the Windows "Startup" folder, don't forget to remove this reference
Note: Some applications store their settings in a user hive, not under HKEY_LOCAL_MACHINE. Therefore you will need to run the application first to set these values, then you can configure the service to run as that user (within service properties)