aspose file tools*
The moose likes I/O and Streams and the fly likes Appending Text to AutoExce.bat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Appending Text to AutoExce.bat" Watch "Appending Text to AutoExce.bat" New topic
Author

Appending Text to AutoExce.bat

Awais Bajwa
Ranch Hand

Joined: Jan 16, 2001
Posts: 191
Hi all ,
I am trying to append some text to autoexec.bat.
First i tried using String buffer .Taking file data into
buffer by opening inputstream and then appending some desired
text to buffer and again writing to autoexec.bat .But it is
dangerous can any one tell me what to do.
Matt Siegel
Ranch Hand

Joined: Jul 18, 2000
Posts: 55
It's pretty easy. Just create a java.io.FileWriter that points to your autoexec.bat file with the append boolean option turned on.

Here's the API for FileWriter:
http://java.sun.com/j2se/1.3/docs/api/java/io/FileWriter.html
HTH!
Matt
[This message has been edited by Matt Siegel (edited April 18, 2001).]
[This message has been edited by Matt Siegel (edited April 18, 2001).]
Awais Bajwa
Ranch Hand

Joined: Jan 16, 2001
Posts: 191
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Appending Text to AutoExce.bat