1.

Solve : Batch File Tidying up?

Answer»

ok Ive created a batch file that checks that Oracle services on a server are running and it works

but when i run the batch file I get all the batch code too

EG my output is:

C:\>SC \\dbscm1 query OracleServiceORACLE1 | FIND "STATE"
STATE : 4 RUNNING

C:\>IF ERRORLEVEL 1 (
echo OracleServiceORACLE1 Not Running
PAUSE
) ELSE (echo OracleServiceORACLE1 Running )
OracleServiceORACLE1 Running



When All I want is:

"OracleServiceORACLE1 Running"


Heres my code

Any Suggestions?

SC \\dbscm1 query OracleServiceORACLE1 | FIND "STATE"
IF errorlevel 1 (
echo OracleServiceORACLE1 Not Running
PAUSE
) ELSE (
echo OracleServiceORACLE1 Running
)

Thanks Graham



HEY I got this working!

echo off..... (whoops my bad)

but if anyone knows how to CHECK what processes are running on a machine using a batch file, could they please tell me how.

thanks

Grahamyou can USE pslist from SYSINTERNALS, or tasklist



Discussion

No Comment Found