Help with Loop in batch File using input from [Solved/Closed]

- - Latest reply: hacker987
Registration date
Wednesday June 24, 2009
Last seen
June 25, 2009
- Jun 25, 2009 at 04:54 PM
Hi Together

I try to scan some PCs remotely and do want to automize this task.

I created a batch file doing a good job, however, it scans only one pc and then I do need to change the target system name.
I now want to create a comma seperated list, stored in a txt that is the reference for the batch to know what PCs to scan and got lost...

Can someone please assist me in getting the following done?

In "Cleer Type" it should like:

IF "c:\myscan\clients.txt" is empty goto :end
For Each Item listed in "c:\myscan\clients.txt" DO
command1.exe CSV /FO >> C:\myscan\logs\log1.txt
command2.exe CSV /FO >> C:\myscan\logs\log2.txt

Sorry, I know I am a lousy coder, but hopefully someone can make my life a bit easier?
Any help is much appreciated.

All the best from PeterPan :)
See more 

4 replies

Best answer
Thank you
Ok guys, after doing some more reasearch due to frustration I found it myself...

For /F "delims=;" %%A in (c:\myscan\clients.txt) do systeminfo.exe /S %%A /FO csv /NH >> C:\myscan\systeminfo.txt"

Say "Thank you" 13

A few words of thanks would be greatly appreciated. Add comment

CCM 4335 users have said thank you to us this month

Thank you
how creat loop batch file in windows xp
Thank you

I want formula, I have many excel file near about 50 file I want convert one file which is csv or html or text file

Plz tell me
Registration date
Wednesday June 24, 2009
Last seen
June 25, 2009
Thank you
just wondering if any1 here knows how to make a batch file send txt from itself to a txt file cuz I want to make a virusmaker but dont know wich line of code I need to use like ok heres a example of wut I want it to do.
@echo off
Title Virus-Maker
color 09
echo Main menu
echo 1.Delete keyboard router
now how do I make this batch file send the code needed to delete the keyboard router and the code is
del C:\Terminal Server Keyboard Driver
how do I make it send this code to a txt file on the desktop?