BOTA-X - Thanks for the reply! I actually responded this weekend, but apparently it didn't post.
First, I will look into your solution - but I have multiple processes that are launched via that bat file. Will I be able to invoke multiple batches?
Second, I thought there was a way to not necessarily make the initial bat file a service, but by posting what the bat file does, to come up with another way to invoke the .exe with parameters. This would be ideal. If you see the code above, it invokes the bat, but passes a variable (name) to launch the respective .exe (%1.exe -serverproperties %1.properties) %1=the specific name of the exe)
Any ideas? THX!
Main Topics
Browse All Topics





by: BOTA-XPosted on 2008-08-09 at 01:45:28ID: 22195653
The short answer is you can't really run the batch file as a service, but you install CMD as a service and pass on the paramter to run the batch file.
First create the service:
Instsrv.exe MyApp Srvany.exe
Follow the instructions in KB137890 to create the registry keys. Set the application string to:
cmd.exe /c path\batchfile.bat
I see that your batch file is not set to loop internally with a GOTO command, and it run once when the OS starts and then terminate. This isn't really how a service is supposed to perform, and quick frankly acts like malware.