Computing.Net > Forums > Programming > [Batch Help] Findstr + Set

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

[Batch Help] Findstr + Set

Reply to Message Icon

Name: biatche
Date: March 21, 2008 at 04:39:08 Pacific
OS: win
CPU/Ram: intel
Product: intel
Comment:

say I have a file named config.ini

content of config.ini is

video=nvidia
os=microsoft

=========

OK, now how do I

SET vga=$(video)
SET os=$(os)

by reading config.ini

... Basically I wanna write a batch file that obtains variables from another file



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: March 21, 2008 at 05:30:04 Pacific
Reply:

This should do it:


@echo off
for /f "tokens=1,2 delims==" %%a in (config.ini) do (
if %%a==video set vga=%%b
if %%a==os set os=%%b
)


0

Response Number 2
Name: biatche
Date: March 21, 2008 at 10:38:49 Pacific
Reply:

Awesome, Thanks.


0
Reply to Message Icon

Related Posts

See More


VS 2008 help please Best programming language...



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: [Batch Help] Findstr + Set

Batch Help: findstr use in for /f www.computing.net/answers/programming/batch-help-findstr-use-in-for-f/16005.html

batch help www.computing.net/answers/programming/batch-help/9952.html

Batch file to set proxy settings www.computing.net/answers/programming/batch-file-to-set-proxy-settings/10409.html