Computing.Net > Forums > Programming > Passing of vars from VBS to BATCH f

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.

Passing of vars from VBS to BATCH f

Reply to Message Icon

Name: Trevor
Date: January 24, 2009 at 22:07:11 Pacific
OS: Windows XP
CPU/Ram: 2gig
Product: Foxconn / 1,8mhz
Subcategory: Batch
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: January 25, 2009 at 00:36:21 Pacific
Reply:

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"

)

0
Reply to Message Icon

Related Posts

See More


Back-up ITunes Files I think this is an easy q...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Passing of vars from VBS to BATCH f

Passing Strings from Fortran to C www.computing.net/answers/programming/passing-strings-from-fortran-to-c/6992.html

Migration from VB to C www.computing.net/answers/programming/migration-from-vb-to-c/8407.html

Passing parameters values from vbs www.computing.net/answers/programming/passing-parameters-values-from-vbs/9060.html