Im using the sc command to query the services running on machines and was using code similar to:
sc \\"server_name" query | find "SERVICE_NAME" > servicelist2.txt
so basically all the server names are listed in this one notepad file. there are 100+ of them. it is too hard to manually put each name in and write 100+ lines of code. is there a way i can use batch itself to direct to the notepad file and iterate through all the server names written in it and then put them back into the "sc" command?
EDIT: Am on windows btw if it wasnt obvious. Using batch scripts for the above.