Computing.Net > Forums > Programming > batch file to take input from .txt

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.

batch file to take input from .txt

Reply to Message Icon

Name: Ashay
Date: February 25, 2009 at 21:36:12 Pacific
OS: Windows
Subcategory: Batch
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: February 25, 2009 at 23:16:53 Pacific
Reply:

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


0

Response Number 2
Name: Ashay
Date: February 26, 2009 at 07:03:47 Pacific
Reply:

Hi Mechanix2Go,

Thanks for your time.

I want to create batch file on windows 2003 server.


0

Response Number 3
Name: Mechanix2Go
Date: February 26, 2009 at 07:58:07 Pacific
Reply:

@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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: batch file to take input from .txt

Batch File|Input from txt file www.computing.net/answers/programming/batch-fileinput-from-txt-file-/17293.html

Batch file to extract data from ini www.computing.net/answers/programming/batch-file-to-extract-data-from-ini/12995.html

Batch file-allowing user input path www.computing.net/answers/programming/batch-fileallowing-user-input-path/16143.html