Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Appending Text to AutoExce.bat

 
Awais Bajwa
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic