Passing of vars from VBS to BATCH f

Foxconn / 1,8mhz
Trevor January 24, 2009 at 22:07:11
Specs: Windows XP, 2gig
I want to read a config.ini files variables only using TEST.VBS as a normal batch file cannot do as vbs can... In other words for instance let say in the ini file there is a line "user=trev" and "password=123" and I'm calling the vbs from a cmd file called RUN.BAT... I will need the variables only from the "user=" and "password=" eg: "trev" and "123" returned to the batch file with out a calling command from the vbs file.. In other words I dont want to re run the batch file again, it must just pass the parameters back to the batch file for futher processing,,, I've found nothing via the internet to support this... Thanks in advance.

See More: Passing of vars from VBS to BATCH f

Report •

January 25, 2009 at 00:36:21
The only thing a program can return to its parent is the ErrorLevel.

Your best bet? Text parsing.

for /f "delims=" %%a in ('cscript //nologo test.vbs') do set %%a

(Assuming test.vbs looks like this:
WScript.StdOut.WriteLine "user=trev"
WScript.StdOut.WriteLine "password=123"


Report •
Related Solutions

Ask Question