Computing.Net > Forums > Windows 2000 > Need to read a text file from a batch file

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.

Need to read a text file from a batch file

Reply to Message Icon

Name: dasarimp
Date: September 15, 2009 at 02:05:47 Pacific
OS: Windows XP
Product: Microsoft Windows xp professional edition
Subcategory: Software Problems
Comment:

Hi,
I would like to read text file e.g. abc.txt from batch file. There will be only one line in abc.txt file as given below...

InstallationPath REG_SZ C:\Program Files\XYZ\My SoftwarePath\

I would like to read the path i.e. "C:\Program Files\XYZ\My SoftwarePath\"

with blanks in it.

Please guide me to solve this problem.

Thanks.
Regards,
Mukund



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 16, 2009 at 09:13:44 Pacific
Reply:

Not very clear, but if you want to set a var try this:

===========================
@echo off & setLocal EnableDELAYedExpansion

for /f "tokens=1-2* delims= " %%a in (abc.txt) do (
set var=%%c
)
echo !var!


=====================================
Helping others achieve escape felicity

M2


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Need to read a text file from a batch file

I need to read a os/2 drive through win 2k www.computing.net/answers/windows-2000/i-need-to-read-a-os2-drive-through-win-2k/9919.html

java routine to read a directory www.computing.net/answers/windows-2000/java-routine-to-read-a-directory/59786.html

Reading a text file from a script www.computing.net/answers/windows-2000/reading-a-text-file-from-a-script/65233.html