Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need to make a batch file run as a service instead of on screen. I have a web server that runs a live java program that leaves a dos window open and I can only lock the console. if I could run the batch as a service then it could be logged off and logged on by other users.

You need srvany.exe from the resource kit. This may not work if the program opens any windows.
From a command prompt type:
INSTSRV MyJavaService c:\Program Files\Resource Kit\srvany.exeAdd any directories from which dll's will be loaded to the system path
Modify Registry to add Parameters needed for your program
Start>Run>REGEDT32
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
You should see the MyJavaService service that you added
Click one of the services to select it, then click Edit>Add Key and enter: Parameters
Click Parameters to select it, then click Edit>Add Value
In the Value Name box type Application
In the String box type d:\path\ToMyProgram\MyProgram.exe
Click Parameters to select it, then click Edit>Add Value
In the Value Name box type AppParameters
In the String box type /switch=option
Click Parameters to select it, then click Edit>Add Value
In the Value Name box type AppDirectory
In the String box type d:\path\ToMyProgram\

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |