Reading from settings.ini file

H

happytoday

I have to see all my seeting in a separate file called eg.
settings.ini contain :
set scriptpath=C:\programs\scripts
set datapath=C:\data\08-09
....


and I need from othe batch files to read those settings . How can I do
it as in Unix
getline var < setting.ini ?
Thanks
 
P

Pegasus \(MVP\)

happytoday said:
I have to see all my seeting in a separate file called eg.
settings.ini contain :
set scriptpath=C:\programs\scripts
set datapath=C:\data\08-09
...


and I need from othe batch files to read those settings . How can I do
it as in Unix
getline var < setting.ini ?
Thanks

Make the settings file a .bat file, then invoke it like so:
@echo off
call "c:\SomeFolder\settings.bat"
 
D

Dutchie

happytoday said:
I have to see all my seeting in a separate file called eg.
settings.ini contain :
set scriptpath=C:\programs\scripts
set datapath=C:\data\08-09
....


and I need from othe batch files to read those settings . How can I do
it as in Unix
getline var < setting.ini ?
Thanks

Great tools for inifiles are varset, varget and inifile.
To be downloaded here: http://home.mnet-online.de/horst.muc/main.htm


But you could get around it using the following ini file:
scriptpath=C:\programs\scripts
datapath=C:\data\08-09

And use the following for loop to set all variables from the ini file:
FOR /F "tokens=1,2 delims=^=" %%A IN (C:\test.ini) DO (SET %%A=%%B )

And check the result using:
ECHO %scriptpath%
ECHO %datapath%
 
F

foxidrive

I have to see all my seeting in a separate file called eg.
settings.ini contain :
set scriptpath=C:\programs\scripts
set datapath=C:\data\08-09
...
and I need from othe batch files to read those settings .

copy settings.ini settings.bat >nul
call settings.bat
del settings.bat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top