HelpImStuck
MIS
I need some help from you guys out there, I've been working on this for awhile and I am so close but I think I've been looking at it to long and the obvious is escaping me.
We have a product we sell that when installed creates a Windows service, when we install multiple systems on the same server it has a service for each installation all with different names. Normally this wouldn't be an issue but now we have quite a few installations and when the server restarts all the services try and restart at the same time bringing the server to it's knees.
To get around this what I did was created a batch file that sequentially started the services use the "net start" command. This however is also problematic because the list then needs to be maintained and the support team has proved not very good at doing this.
So what I am so close to doing now is having a batch file that will query the service manager, get me a list of services and then in a for loop start each of the services.
The problem is I have to use a 3rd party tool to remove some text from the list of services and I would like to remove this dependancy.
To get a list of services stored in a text file I run:
sc query state= all | find "JBoss" | findstr "DISPLAY_NAME STATE" > C:\JBoss.txt
This gives me a list like:
DISPLAY_NAME: JBossSOMETHINGHERE1
DISPLAY_NAME: JBossSOMETHINGHERE2
Then the 3rd party tool I use removes the text "DISPLAY_NAME:" from the file and I go into a for loop.
for /F %%a in (C:\Jboss.txt) do (
net start %%a
C:\sleep.exe 300
)
Now this does work but is there a DOS way to remove that static text so I don't have to use a 3rd party GREP tool. Or some other command that will just allow me to skip over that piece in the file.
Any help here would be greatly appreciated.
We have a product we sell that when installed creates a Windows service, when we install multiple systems on the same server it has a service for each installation all with different names. Normally this wouldn't be an issue but now we have quite a few installations and when the server restarts all the services try and restart at the same time bringing the server to it's knees.
To get around this what I did was created a batch file that sequentially started the services use the "net start" command. This however is also problematic because the list then needs to be maintained and the support team has proved not very good at doing this.
So what I am so close to doing now is having a batch file that will query the service manager, get me a list of services and then in a for loop start each of the services.
The problem is I have to use a 3rd party tool to remove some text from the list of services and I would like to remove this dependancy.
To get a list of services stored in a text file I run:
sc query state= all | find "JBoss" | findstr "DISPLAY_NAME STATE" > C:\JBoss.txt
This gives me a list like:
DISPLAY_NAME: JBossSOMETHINGHERE1
DISPLAY_NAME: JBossSOMETHINGHERE2
Then the 3rd party tool I use removes the text "DISPLAY_NAME:" from the file and I go into a for loop.
for /F %%a in (C:\Jboss.txt) do (
net start %%a
C:\sleep.exe 300
)
Now this does work but is there a DOS way to remove that static text so I don't have to use a 3rd party GREP tool. Or some other command that will just allow me to skip over that piece in the file.
Any help here would be greatly appreciated.