Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript to find text and then change value in text file

Status
Not open for further replies.

anupamdewan

Technical User
Nov 30, 2010
1
NZ
Hey Guys,

It might be a very easy question for you guys but I am unable to find anything useful about this on the web.


This is what I want to do..

1. Check whether folder exists or not (C:\Program Files\abc) and throw error if doesnt exists

2. Read a text file from abc folder and search for a string XYZ.

3. Check if value of XYZ=0 (if exists GOTO Step 4) and if not (say XYZ=100) then change it to XYZ=0

4. Run executable C:\Program Files\abc\test.exe


Any help regarding this will be really appreciated.
 
Well, it looks like you've got some basic psuedocode. The way I would do this is to open two files and copy content from one file to the other line by line; processing the data in between. There is a plethora of information on the web that tells you how to do this. Here's a good place to start


This can be accomplished in just a few lines of code.

- Geates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top