September 21st, 2011, 02:52 PM
Need some scripting help parsing a file.
Iíd like for this command to go through the file and spit out the name of services that are set to AUTO_START, but it tells me every service name, and after the ones with AUTO_START, itíll output the findstr results.
I'd like for it to look like this...
START_TYPE : 2 AUTO_START
This is the command I'm running...
(Services.txt contains simple list of services.)
for /f %i in (services.txt) do sc qc %i | findstr ďAUTO_STARTĒ & echo %i
What Iím doing isnít working and Iíve hit a wall. I was thinking I might be able to use an IF statement in conjunction with the FOR, but haven't been able to find anything on doing that.
Iíd appreciate any help.