durex
-
Total Posts
:
21
- Scores: 0
-
Reward points
:
0
- Joined: 3/8/2005
- Location:
-
Status: offline
|
Create VBScript to read in file values?
Tuesday, March 08, 2005 6:30 PM
( permalink)
Been looking around and havent been able to find much about what Im hoping to do. I want to create a vbscript which will read in particular values from a 'config file'. This config file will have something similar to the following:
ProgName="prog.exe"
ProgPath="c:\temp"
ProgDesc="this is a prog" and then repeated for multiple programs. is this something i can accomplish with vbscript? Thanks!
|
|
|
|
token
-
Total Posts
:
1917
- Scores: 0
-
Reward points
:
0
- Joined: 1/14/2005
- Location:
-
Status: offline
|
Re: Create VBScript to read in file values?
Tuesday, March 08, 2005 6:46 PM
( permalink)
Sure, you can use VBS to accomplish that. The following script should get you started. Replace the file with the actual absolute path of the file you intend to read from. ================================================================================================ Option Explicit Dim fso, temp, ts, file Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(file,1) file = "F:\test.txt" Do Until ts.AtEndOfStream temp = Split(ts.ReadLine,"=") WScript.Echo "Key : " & temp(0) & vbTab & vbTab & "Value: " & temp(1) Loop
|
|
|
|
durex
-
Total Posts
:
21
- Scores: 0
-
Reward points
:
0
- Joined: 3/8/2005
- Location:
-
Status: offline
|
Re: Create VBScript to read in file values?
Wednesday, March 09, 2005 3:45 AM
( permalink)
Excellent... just what I was looking for. Thanks!
|
|
|
|
token
-
Total Posts
:
1917
- Scores: 0
-
Reward points
:
0
- Joined: 1/14/2005
- Location:
-
Status: offline
|
Re: Create VBScript to read in file values?
Wednesday, March 09, 2005 4:10 AM
( permalink)
|
|
|
|