batch file to take input from .txt

February 25, 2009 at 21:36:12
Specs: Windows
Hi all.

I need to create batch file which will take input from a text file and excuate command.
My batch file will contains a following command
dscvrbe -7 <IP_address/Machine_Name> -v 9 >log.txt

My txt file will contains IP address or machine name. which i need to replace with <IP_address/Machine_Name> in command in batch file.
Please suggest me a code.

Thanks,
Ashay


See More: batch file to take input from .txt

Report •


#1
February 25, 2009 at 23:16:53
Much depends on the EXACT version of Windows.

Like it says in the posting guidelines.


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

M2


Report •

#2
February 26, 2009 at 07:03:47
Hi Mechanix2Go,

Thanks for your time.

I want to create batch file on windows 2003 server.


Report •

#3
February 26, 2009 at 07:58:07
@echo off & setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in (my.txt) do (
dscvrbe -7 %%a -v 9 >> log.txt
)


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

M2


Report •

Related Solutions


Ask Question