Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i am using dos on a win 98 machine.
i have a bat file that will store information in a readme.txt file. it will store 1 word on the first line of this file, and 1 word on the second. so inside the file, it looks like this:test
datafrom a second, different bat file, i want to be able to pull each of these two words into seperate variables. where 'myvar1' contains 'test' and 'myvar2' contains 'data'. i am greatful for any help
thanks

This should work:
===== BATCH SCRIPT BEGIN =====
@echo off
type README.TXT> %TEMP%.\T1.BATecho e100'SeT %%1='> %TEMP%.\T2.BAT
for %%? in (rcx 7 w q) do echo %%?>> %TEMP%.\T2.BAT
type nul> %TEMP%.\T3.BAT
DEBUG %TEMP%.\T3.BAT < %TEMP%.\T2.BAT > nultype %TEMP%.\T1.BAT>> %TEMP%.\T3.BAT
FIND "SeT %%1=" < %TEMP%.\T3.BAT > %TEMP%.\T1.BAT
call %TEMP%.\T1.BAT myvar1
FIND/v "SeT %%1=" < %TEMP%.\T3.BAT > %TEMP%.\T1.BATDEBUG %TEMP%.\T3.BAT < %TEMP%.\T2.BAT > nul
type %TEMP%.\T1.BAT>> %TEMP%.\T3.BAT
FIND "SeT %%1=" < %TEMP%.\T3.BAT > %TEMP%.\T1.BAT
call %TEMP%.\T1.BAT myvar2for %%? in (1 2 3) do del %TEMP%.\T%%?.BAT
===== BATCH SCRIPT END =====Watch out for line wrapping!
Does the script look weird? Yes.
Does the script work? Yes.-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
toshiba t1100 plus
|
Unique .Com file request
|

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