Chris Miller
asked on
SC Query Script to only show service name and state
CN.txt - List of computernames
services.txt - list of services to check
@echo off
for /f %%a in (CN.txt) do (
echo %%a >> Output.txt
for /f "tokens=*" %%b in (services.txt) do (
sc \\%%a query "%%~b" >> Output.txt
)
)
pause
How do I clean this script up to only show the Service_Name and state?
services.txt - list of services to check
@echo off
for /f %%a in (CN.txt) do (
echo %%a >> Output.txt
for /f "tokens=*" %%b in (services.txt) do (
sc \\%%a query "%%~b" >> Output.txt
)
)
pause
How do I clean this script up to only show the Service_Name and state?
ASKER
How do I use that for one service? the service I am looking for in the "Windows Agent Service"
ASKER
and how do I add a list of computernames ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
orOpen in new window