Question How to parse, edit and save a Batch file?

Rays1989

New member
Joined
Mar 10, 2011
Messages
3
Programming Experience
Beginner
I have a "Run.bat" file for running a java application.
I need to open it and change the "Java_Home" path and some other parameters.
Need suggestion and if possible some sample logic/code.
 
System.IO Namespace ()
The tools in that namespace is for handling file IO, such as reading and writing files. You can for example use the File.ReadAllText or ReadAllLines method.
For manipulation of strings the String class, as represented by the String data type, offer many methods.
For more advanced string handling, ie pattern matching using regular expressions, there is the Regex class.
Once done you can write the file using the corresponding File.Write methods as you did for File.Read.
 
Back
Top