1.

Solve : Batch Files to Check Services on local Machine?

Answer»

I wish to create a batch file that will check if a service is running on my machine (namely OracleOraHome92TNSListener).

I have no IDEA how to do this as I only have a very basic understanding of MSDOS

if ANYONE could show me a solution or at least point me in the right direction. that would be great!

thanks GrahamUse the "sclist" COMMAND from the [RK]

Something like this should do it:
set service=name of the service you want to check

sclist | findstr /i %service%| findstr /i running
IF %ERRORLEVEL% EQU 0 (echo %service% running)
IF %ERRORLEVEL% NEQ 0 (echo %service% is not running)


hope it helps
uli

I dont understand what [RK] means.
As I mentioned I have a very limited knowledge of MSDOS (im PROBABLY attempting to bite off way more than i can chew here)

I should have also mestioned that my OS is windows XP Professional Version 5.1.2600

sorry!

I tried to create a similar program in .NET but to no avail

Graham[RK] means Ressource Kit.
Maybe "SCLIST" is standard in XP. In NT4 it is in the [RK].

hope it helps
uli



Discussion

No Comment Found