Creating new BAT file script to stop, restart and disable S I agent

We have just installed BOXI3 and are in the process of updating some bat files for stopping, restarting and failover (to our backup servers)and disable services on the Central Configuration Manager.   In my old scripts we called each service  Examples (
sc
servername.net config "bobjspcengine" start= disabled                    
sc
servername.net config "BOBJWebiServer" start= disabled)
I have a few  questions
1.  Server Intelligence Agent... Where would I find it's name   like the BOBJWebiServer example?
2.  If my bat file stops this agent does that automatically stop the CMS, Webi, Report services?
3. This is for our support team in order to easliy stop Tomcat and other services for failing over to our DR sites and backups since the script automatically stops,  starts, restarts disables and enable services..., is this the best approach?   We put these bat files out on the servers and all they do is click on them to start the failover process.

Try using
Process Monitor for looking the key.
For example, you may set the required value through the group policy and see what windows registry keys are changed.

Similar Messages

  • How to create a .bat file

    Hi,
    I want to transfer and run my program on a computer
    that don't have JDK. I want to create a .bat file or
    something like that. How exactly is this done? I guess
    I have to include all the javaclass files that my program
    is using. Can I put everything in one directory and than
    zip it and create the path in a .bat file?
    Please help me I can't figure this one out...

    Steps of creating a DOS batch file.
    1. The machine that will run these Java programs needs the JRE or JDK installed on it. If it is an applet, a web browser is OK.
    If you are using just standard core Java packages such as
    java.awt.*
    java.awt.event.*
    java.io.*
    java.net.*
    (and others... not extension packages such as javax.swing.*, Java 3D, etc)
    you may not need JDK and can just use Microsft's JVM which is jview.exe on the windows directory, C:\Windows
    2. Create a new directory to store all the Java class files, data files, images and other resources that the program makes use of.
    3. Create a batch file that will install and/or run the program IN THE SAME DIRECTORY as the class files.
    4. Go into the batch file properties by right mouse clicking on the batch file and selecting properties. Go to the programs tab at the top and look at the 'working' and 'cmd line' properties. These two need to be blank. If there are any values in there, then delete them.
    5. Zip the directory using WinZip and then create a self-extracting executable. (Just right mouse click on the directory and select the 'Add to zip' option).
    6. Save to a floppy or another location.
    Here is a sample batch file:
    (Assumes that the directory with all your files is called myprog and is saved on the floppy disk
    Your program that has main method is called Main)
    rem -----start batch file--------
    @echo off
    cd c:\
    mkdir myprogs
    cd myprogs
    copy a:\myprogs\*.* .
    echo all done!
    echo running application...
    java Main (or jview Main)
    rem -----end of batch file--------
    If you are using UNIX/Linux then a shell script needs to be created. This is then executed by using the commands:
    sh <myshellscriptname>.sh
    Hope this helps!
    Rizwan

  • Create new text file in UTF-8 format by default

    I'm working a lot with UTF-8 text files and mainly in this format. It's becoming annoying when I have to manually save every text file as UTF-8.  After several trial-and-errors, I've made up a procedure that I've put in a blog. I think I could share
    it here for those who need it.  Hope it helps.
    http://instrumenti-meliora.blogspot.com/2014/04/create-new-text-file-in-utf-8-format-by.html

    You've made a procedure?
    Are you sure you didn't :
    Didn't what?
    https://www.google.com/#q=change+notepad+default+encoding
    Well, I'm not sure what you want me to see, but your search keywords do
    NOT make sense.  You do note change *Notepad* default encoding.  What you can change is a
    TEXT file's default encoding.
    Well, of course, if you have access to Notepad source code and you're able to change it and re-compile again, then you could really say you change Notepad's "default encoding", which I suppose would mean "default encoding every time we save".
    Why wouldn't you just provide a link (or some attribution) to the top result
    http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/default-utf-8-encoding-for-new-notepad-documents/525f0ae7-121e-4eac-a6c2-cfe6b498712c
    or a link to watch this done on youtube?
    http://www.youtube.com/watch?v=GnL6smxQE9k
    The title of that forum post and Youtube video is a non-sense.  New
    "Notepad" document?  Come on!  That's apparently how a newbie think what it is and it's very likely he has not a clue what it is and what he is doing.  And what if I don't use Notepad to create such file?  If I
    use UltraEdit, then mine should be "UltraEdit" document and that should be different from Notepad document, correct? LOL
    The fact that you're able to find this video would also mean you're thinking like him in that the file is really called Notepad document LOL
    For your information, that's called a text file (or document if you prefer this prettier term).  It's also called plain text file.
    Now, let's see the content of both links:
    First of all, why did they tell people to create a new text file somewhere and then
    COPY it to template folder?  That's really so dumb
    LOL  Isn't it more intelligent to create such file directly INSIDE the folder?
    Secondly, their procedures are not foolproof.  What if the Windows directory is not c:\windows?  They should tell people to open %Systemroot%\ShellNew instead.  I suppose they don't even know how this folder is called because
    nowhere is the term "template folder" ever mentioned.
    Thirdly, what if that folder doesn't work for unknown reason (which might happen in XP)?  Did they give any hint to a "failover" folder?  No, they didn't.  But I do in my procedure.
    Fourthly, they are saying as if the file name has to be "TXTUTF-8.txt", but actually we can call it whatever we like.  But smart people would have figured this out at the end.
    5 (I'd stop saying fifthly and so on LOL) I'm not sure it's necessary (or recommended) to change "fSavePageSettings" & "fSaveWindowPositions" DWORD values for Notepad as "advised" in that answer.
    As a side-note, I don't know what
    http://www.pc1news.com/saving-changes-to-notepad-configuration-1216.html is supposed to give but when I open this, I got some uTorrent warning.  Really seems like some malware webpage which tries to deceive people!
    I actually searched how a (generic) new file is created and started from there.
    So, maybe next time when you want to criticize or discredit somebody else, try to be more expert first? ;)

  • How to create new XML file using retreived XML content by using SAX API?

    hi all,
    * How to create new XML file using retreived XML content by using SAX ?
    * I have tried my level best, but output is coming invalid format, my code is follows,
    XMLFileParser.java class :-
    import java.io.StringReader;
    import java.io.StringWriter;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.TransformerHandler;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.XMLFilterImpl;
    public class PdfParser extends XMLFilterImpl {
        private TransformerHandler handler;
        Document meta_data;
        private StringWriter meta_data_text = new StringWriter();
        public void startDocument() throws SAXException {
        void startValidation() throws SAXException {
            StreamResult streamResult = new StreamResult(meta_data_text);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
            try
                handler = factory.newTransformerHandler();
                Transformer transformer = handler.getTransformer();
                transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                handler.setResult(streamResult);
                handler.startDocument();
            catch (TransformerConfigurationException tce)
                System.out.println("Error during the parse :"+ tce.getMessageAndLocation());
            super.startDocument();
        public void startElement(String namespaceURI, String localName,
                String qualifiedName, Attributes atts) throws SAXException {
            handler.startElement(namespaceURI, localName, qualifiedName, atts);
            super.startElement(namespaceURI, localName, qualifiedName, atts);
        public void characters(char[] text, int start, int length)
                throws SAXException {
            handler.characters(text, start, length);
            super.characters(text, start, length);
        public void endElement(String namespaceURI, String localName,
                String qualifiedName) throws SAXException {
            super.endElement("", localName, qualifiedName);
            handler.endElement("", localName, qualifiedName);
        public void endDocument() throws SAXException {
        void endValidation() throws SAXException {
            handler.endDocument();
            try {
                TransformerFactory transfactory = TransformerFactory.newInstance();
                Transformer trans = transfactory.newTransformer();
                SAXSource sax_source = new SAXSource(new InputSource(new StringReader(meta_data_text.toString())));
                DOMResult dom_result = new DOMResult();
                trans.transform(sax_source, dom_result);
                meta_data = (Document) dom_result.getNode();
                System.out.println(meta_data_text);
            catch (TransformerConfigurationException tce) {
                System.out.println("Error occurs during the parse :"+ tce.getMessageAndLocation());
            catch (TransformerException te) {
                System.out.println("Error in result transformation :"+ te.getMessageAndLocation());
    } CreateXMLFile.java class :-
    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();
    Sax.endElement("", "basic-metadata", "basic-metadata");* In CreateXMLFile.java
    class, I have retreived the xml content in the meta_data object, after that i have converted into character array and this will be sends to SAX
    * In this case , the XML file created successfully but the retreived XML content added as an text in between basic-metadata Element, that is, retreived XML content
    is not an XML type text, it just an Normal text Why that ?
    * Please help me what is the problem in my code?
    Cheers,
    JavaImran

    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    </code><code>Sax.endElement("", "basic-metadata", "basic-metadata");</code>
    <code class="jive-code jive-java">Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();     
    * I HAVE CHANGED MY AS PER YOUR SUGGESTION, NOW SAME RESULT HAS COMING.
    * I AM NOT ABLE TO GET THE EXACT OUTPUT.,WHY THAT ?
    Thanks,
    JavaImran{code}

  • On Upgrade (from Office 2010) don't create new .ost file

    Hi there, hope someone can help me.
    Here is my Problem:
    I'm runninng Office 2010 (32Bit Version) on Windows 7 Enterprise x64. I've started Office 2010 with Exchange CacheMode activated. The ost-file is located under D:\Data\outlook\%username%
    Now I'm testing Migration to Outlook 2013.
    I'm using OAT to do the following things (regarding only Outlook):
    - Uninstall of Office 2010
    - Install of Office 2013 with using old settings
    -Features:  Configuring "Do not create new ost file during Migration" (we have many subsidiaries with low performance connections - so the old ost should be used after migration)
    Outlook-Profile: Tried all 3 methods (use existing profile | change profile | new Profile)
    At all my tests Outlook creates a new .ost-file under standard directory and don't use  the existing ost-file under D:\Data\%Username%
    After These tests i tried it with gpo "donotcreatenewostonupgrade" - But in this case also a new ost is created.
    In all cases i have 2 Outlook profiles: "Outlook" (with new ost) and "Backup of Outlook" (with old ost)
    By Setting ForceOSTPath to D:\Data\outlook\%username"
    and Donotcreatnewostonupgrade to 1
    i get two .ost's under D:\Data\outlook\%username" - "outlook.ost" and "Outlook data file.ost"and two mailprofiles "BACKUP OF Outlook" and "Outlook"
    So ForceOSTPath is getting used, but Donotcreatnewostonupgrade not *confusing*
    Can someone cann tell me a solution for this problem?
    Best regards
    Daniel
    Best regards
    Daniel

    Hi Daniel,
    What OAT tool are you using? Is it the Office Customization Tool?
    Where did you get the "Do not create new ost file during Migration" option in the tool? As far as I know, OST file cannot be migrated. If you were able to use the old OST file, Outlook will prompt that it
    doesn't match the server mailbox.
    The ForceOSTPath applies only to new profile, it can't be used to force Outlook to use the old OST file.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Not able to create New Transformation file in BPC

    I am getting error in BPC 10.0 when creating new transformation file from the EPM tab in Excel.
    When i click on create New transformation then some garbage value appear on the Excel cells. Problem with Authorization is not the case as i have checked all the authorizations in BI and BPC.
    Attached is the screen shot of the same.

    Hello Nidheesh,
    Can you check in UJFS Tcode whether you have file named newconversiontable.xlt and newtransformation.xlt in \ROOT\WEBFOLDERS\ADMINTEMPLATES.
    Also can you check the Language settings of yours in Excel Option
    Regards
    Bhagyesh Ravange

  • How can I add a "Create New Text File" contextual menu?

    Hi,
    I'd like to add a "Create New Text File" contextual item. I found the "new text file" action in Automator, but I don't really know where to go from there... I want it to work on the desktop and in finder...
    Thanks

    See:
    Mac OS X Automation,
    Automated Workflow Tips,
    Introduction to Automator tutorial, and
    a four-parter on Automation in Snow Leopard by Sal Saghoian:
    Snow Leopard Services,
    Services for iPhoto,
    Safari and WebKit integration, and
    Installing and using services.
    Finally, 
    Developing AppleScript Applications and
    Apple's Automator Developer Documentation

  • Creating new text file (txt.) everytime a string is passed in

    Dear all, need some help from you all. I am now developing a web service program to allow users to type in a string of characters. And will need to create txt. file to store this strings. Currently, i hard code the directory and the name of the txt file (e.g C:\\test.txt) does anyone know if possible solution to create new txt. file (using different names) whenever a string is passed in from the web service? I am using J2EE as programming language and BEA Workshop for Weblogic Platform version 10.
    Thank You very much.

    well, make the name as argument.
    and new File(name)...blablablabla

  • On Upgrade (form Office 2010) don't create new .ost file

    Hi there, hope someone can help me.
    Here is my Problem:
    I'm runninng Office 2010 (32Bit Version) on Windows 7 Enterprise x64. I've started Office 2010 with Exchange CacheMode activated. The ost-file is located under D:\Data\%username%
    Now I'm testing Migration to Outlook 2013.
    I'm using OAT to do the following things (regarding only Outlook):
    - Uninstall of Office 2010
    - Install of Office 2013 with using old settings
    -Features:  Configuring "Do not create new ost file during Migration" (we have many subsidiaries with low performance connections - so the old ost should be used after migration)
    Outlook-Profile: Tried all 3 methods (use existing profile | change profile | new Profile)
    At all my tests Outlook creates a new .ost-file under standard directory and don't use  the existing ost-file under D:\Data\%Username%
    After These tests i tried it with gpo "donotcreatenewostonupgrade" - But in this case also a new ost is created.
    In all cases i have 2 Outlook profiles: "Outlook" (with new ost) and "Backup of Outlook" (with old ost)
    Can someone cann tell me a solution for this problem?
    Best regards
    Daniel

    Hi
    As per the information and details provided by you, to migrate lost file from Outlook 2010 to 2013, please follow these steps: -
    You need to use one of the two methods to move the OST file and both involve a new profile. If you are making a new profile, you can use
    ForceOSTPath registry key. Or you can move the ost file and create a new profile in the Control Panel, Mail applet and point it to the new location.
    Copy your ost file to the new location. You can skp this step if you want to create a new ost file.
    Open the
    Control panel, find Mail.
    Click Show Profiles.
    Click Add.
    Type a name for your new profile, click
    Ok.
    Enter your
    username and password and let Outlook find your account information.
    Select the
    Change account settings option, and then click Next.
    Click
    More Settings.
    On the
    Advanced tab, click Outlook Data File Settings.
    Click
    Browse, browse to the ost file, then click Open.
    If you want to create a new ost file, browse to the new location,
    enter a filename, and then click Open, Outlook will create the new ost file.
    Click
    Always use this profile, select the new profile that you created, then click
    Ok to close the dialog.
    Using ForceOSTPath to set the file location
    Open the registry editor and browse to this key. Create a string value named ForceOSTPath and add the path. (You can use variables, if
    you are using group policy to push it out to your users).
    Outlook 2013
    HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook Expandable String Value: ForceOSTPath Value data: full path you want to use
    Outlook 2010
    HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook Expandable String Value: ForceOSTPath Value data: full path you want to use
    I hope this information will be helpful for you.
    Thanks and regards
    Shweta@G 

  • How to create a bat file by abap?

    hi~
    i ask a elementary question.how to create a bat file in my local pc?how to write some message in this bat file ?thank you !

    execute bat-files
    Reward Points if it is helpful
    Thanks
    Seshu

  • SAX: How to create new XML file using SAX parser

    Hi,
    Please anybody help me to create a XML file using the Packages in the 5.0 pack of java. I have successfully created it reading the tag names and values from database using DOM but can i do this using SAX.
    I am successful to read XML using SAX, now i want to create new XML file for some tags and its values using SAX.
    How can i do this ?
    Sachin Kulkarni

    SAX is a parser, not a generator.Well,
    you can use it to create an XML file too. And it will take care of proper encoding, thus being much superior to a normal textwriter:
    See the following code snippet (out is a OutputStream):
    PrintWriter pw = new PrintWriter(out);
          StreamResult streamResult = new StreamResult(pw);
          SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory.newInstance();
          //      SAX2.0 ContentHandler.
          TransformerHandler hd = tf.newTransformerHandler();
          Transformer serializer = hd.getTransformer();
          serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");//
          serializer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,"pdfBookmarks.xsd");
          serializer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,"http://schema.inplus.de/pdf/1.0");
          serializer.setOutputProperty(OutputKeys.METHOD,"xml");
          serializer.setOutputProperty(OutputKeys.INDENT, "yes");
          hd.setResult(streamResult);
          hd.startDocument();
          //Get a processing instruction
          hd.processingInstruction("xml-stylesheet","type=\"text/xsl\" href=\"mystyle.xsl\"");
          AttributesImpl atts = new AttributesImpl();
          atts.addAttribute("", "", "someattribute", "CDATA", "test");
          atts.addAttribute("", "", "moreattributes", "CDATA", "test2");
           hd.startElement("", "", "MyTag", atts);
    String curTitle = "Something inside a tag";
              hd.characters(curTitle.toCharArray(), 0, curTitle.length());
        hd.endElement("", "", "MyTag");
          hd.endDocument();
    You are responsible for proper nesting. SAX takes care of encoding.
    Hth
    ;-) stw

  • Creating a .bat file to compile .java files

    Hi,
    I am trying to create a .bat file to compile java files. I have created the .bat in the same folder as teh .java file I am trying to compile. I know the path is set to the proper folder to find the compiler, but I keep getting an error saying the system can not find the specified file, or can not read fileName.java. Everything is spelled correctly, and I know it works because it will compile from the command prompt. Any suggestions?

    rather than including a sourcepath, just specify the full location. Using your example, this would read like
    javac "C:\Documents and Settings\Kevin\Desktop\School Stuff\AP Comp Sci\PowerPoints\Chapter 02\Executables\Section 2.2\Facts.java"Note that everything is inside the inverted commas " "
    I tried this on a hello world Java program inside a brief case and it works fine.
    The class file is created inside the briefcase.
    If you want to create a bat file to do this from anywhere, modify your batch file to look like this:
    c:\
    cd "C:\Documents and Settings\Kevin\Desktop\School Stuff\AP Comp Sci\PowerPoints\Chapter 02\Executables\Section 2.2"
    javac %1.java
    java %1Again, you would use this as follows
    mybat FactsDon't forget to leave out the .java extension.
    This will compile the java file and attempt to run it for you.
    If you don't want it to run, leave out the java%1
    If you create other java files in this same briefcase folder you can use mybat to compile them too.
    For example
    mybat Facts2

  • Creating windows .bat file from within an oracle .prc or .sql file

    I am currently converting a series of batch jobs on a windows server to use an Oracle db rather than a MS sql server db. In ms sql, I could call \mssql80\binn\isql and it allowed me to pass in .prc files and have a .bat file returned. the .bat file is then executed in the calling bat to set variable value returned in the sql call...
    I am thinking I can spool a bat file, however, i do not know how to populate this file with the literals and query values needed to create the bat file which sets values used for further processing in the original calling bat file...
    Does that make sense? any help is greatly appreciated.

    Hi,
    There can be various ways to do this.
    First and simple way is simply spooling out the batch file. Suppose you have a .sql file with all the queries, run the .sql from DOS prompt like this,
    c:\> sqlplus -s username/password@tnsname @mysqlfile.sql
    the contents of mysqlfile.sql can be,
    rem ---------------------
    set echo off feedback off head off
    spool c:\batch_files\mybatch.bat
    select 'start \w ' || win_app_name from mytable ;
    spool off
    rem ----------------------
    exit
    So, you can get the batch file created with desired name in desired directory. The '-s' mentioned in the sqlplus command is important.
    There is another difficult/tedious way, but that can give you exact output. With UTL_FILE package you can write an operating system file from pl/sql code, stored procedure/package. Its look more like C-language code, but is usefull. So, write a sql or stored procedure and create the batch file. For that matter, you can write any type of file, just you can write whatever you want to a file.
    Cheers

  • HOw to create a text file in the given path and delete it after the use?

    Hi all,
    I am trying to create a text file at the given path and delete the created file after the use.
    I am using following code.:
    import java.io.*;
    // write binary data as characters
    public class RanIO {
                                            public static void main(String f[])
                                                      // First illustrate append
                                                      String lineSep = "\n";
                                                      try {
                                                                     File temp= new File("C:/Ash","cute.txt");
                                                      boolean ch=temp.createNewFile();
                                                      if(ch)
                                                           System.out.println("file created");
                                                      else
                                                      System.out.println("file Not created");
                                                      //writing to file
                                                 /*     PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
                                                      p.print("Emp NO");
                                                      p.close();*/
                                                                // Open fileWriter in append mode
                                                                               FileWriter fos = new FileWriter(temp, true);
                                                                               BufferedWriter bw = new BufferedWriter(fos);
                                                                               PrintWriter pw = new PrintWriter(fos);
                                                                               double d=550;
                                                                          // lineSep = System.getProperty("line.separator");
                                                                          pw.print("Hello");
                                                                          //pw.print( lineSep );
                                                                          pw.print( d );
                                                                          pw.close();
                                  boolean det=temp.delete();
                                                 if(det)
                                                      System.out.println("File deleted");
                                                 else
                                                      System.out.println("File not deleted");
                                                 } catch (IOException ioe)
                                                                System.out.println( "Append IO error:" + ioe );
    My problem:
    1)
    I am not able to write to the file. I want to know, where i am going wrong.
    It is giving error message like
    "Canot resolve Symbol: temp,"
    But, FileWriter Constructor should accept a File type parameter.
    here temp is a file parameter.
    If i am not using file=new file();
    i can't delete the file after the use. i.e if i use
    PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
    how can i delete cute.txt after the use?
    2)
    I am not able to write to the text file. file is created but, a blank file.
    "Hello" is not written into the text file.
    can anyone help me in this regard
    Thanks in advance
    Ashvini

    Thank you Ram,
    But, i want to create a text file in Append mode.
    for that i used
    FileWriter fos = new FileWriter(temp,true); But, it is not accepting FileWriter constructor in
    this format. if i use
    FileWriter fos = new
    FileWriter("c:/ash/cute.txt",true); it works fine. !!!!!Here's the javadoc
    public FileWriter(File file,
    boolean append)
    throws IOExceptionConstructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
    Parameters:
    file - a File object to write to
    append - if true, then bytes will be written to the end of the file rather than the beginning
    Throws:
    IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    Since:
    1.4
    Are you using jdk.13 or lower ?
    >
    ONe more doubt, Does flush method deletes a file?
    if not, then i need to use
    File temp=new File("c:/ash/cute.txt");
    FileWriter fos = new FileWriter(temp,true); //which
    is again a problem
    if(temp.delete())
    out.println("File is deleted");
    }I don't know whether i am taking it wrong ! or
    anything wrong with my coding ! but, after creating
    and writing data into a text file. I must delete it
    as it contains confidential informations.
    Regards,
    Thanks.'flush' writes to a file immediately. Else you should explicitly call 'flush' to write contents from buffer to underlying source.
    javadoc again
    PrintWriter
    public PrintWriter(Writer out,
    boolean autoFlush)Create a new PrintWriter.
    Parameters:
    out - A character-output stream
    autoFlush - A boolean; if true, the println, printf, or format methods will flush the output buffer
    cheers,
    ram.
    Question; What do you gain by opening a file, writing to it and deleting it in the same program ?

  • When I open iTunes, I get a message that "iTunes has stopped working".  I've tried reinstalling itunes, creating a new user file, changing the startup programs, and am having no success in getting iTunes to stay open. Any "fixes" for this problem?

    When I open ITunes, I get a message that "iTunes has stopped working".  I have tried reinstalling iTunes, creating a new user file, changing the startup programs in accordance with articles in iTunes troubleshooting, but am having no success in getting iTunes to stay open.  Any fixes for this problem?

     

Maybe you are looking for