• 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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!