Computing.Net > Forums > Programming > DOS - FOR Command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS - FOR Command

Reply to Message Icon

Name: JAVO
Date: August 1, 2006 at 12:01:37 Pacific
OS: XP
CPU/Ram: N/A
Product: N/A
Comment:

I need help with a batch file. Basically I've got a list of servers I need to run through and running a command for each. Here it is.

for /f %%a in (serverlist.txt) do srvsec \\%%a >> srvsec.txt

That command above works great.. No problems. But I need to be able to echo the %%a before I run the srvsec command..
My question is how do I run 2 commands using something like the above?



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: August 1, 2006 at 14:49:03 Pacific
Reply:

for /f %%a in (serverlist.txt) do (
echo %%a
srvsec \\%%a >> srvsec.txt
)



=====================================
If at first you don't succeed, you're about average.

M2



0
Reply to Message Icon

Related Posts

See More


self executable creating popup child wind...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: DOS - FOR Command

DOS 'For' Command www.computing.net/answers/programming/dos-for-command/20184.html

c prog (Borland) for dos dir command www.computing.net/answers/programming/c-prog-borland-for-dos-dir-command/844.html

DOS for loop www.computing.net/answers/programming/dos-for-loop/17251.html