Read a .properties file in batch

May 12, 2011 at 19:39:57
Specs: Windows 7
I have a properties file (my.File.properties) that contains the lines
...
my.webSphere.directory=
my.webSphere.profile=
...

The user will fill those parameter say

...
my.webSphere.directory=D:\IBM\WebSphere\AppServer\profiles\AppSrv01\bin
my.webSphere.profile=AppSrv01
...

Now, I want to create a batch file that gets the parameter my.webSphere.directory and my.webSphere.profile from my.File.properties

Thanks!!!


See More: Read a .properties file in batch

Report •


#1
May 13, 2011 at 02:39:06
@echo off
for /F "delims=" %%j in ('type "my.File.properties"') do set %%j
set my.webShere

And now... beware the environment variables the batch sets up are not persistent, i.e. they vanish at batch's end.

Report •
Related Solutions


Ask Question