Please tell me e code to clear the dos screen in my program

please sir/mam if u colud plz elp me to know hoe th clear the dos screen in java and I had tried the code i.e.
Runtime.getRuntime.exec("cls")
but it did not worked so plz help me out
u can mail me at [email protected]

class ClearScreen
     public static void main(String[] args)
          //  The following code needs ansi.sys added to config.sys
          //  DEVICE=C:\WINDOWS\COMMAND\ANSI.SYS
//          char esc = 27;
//          String clear = esc + "[2J";
//          System.out.print(clear);
          //  this will work in all cases
          for (int i = 0; i < 250; i++)
               System.out.println();
}

Similar Messages

  • How to clear the DOS screen through java program

    how to clear the DOS screen through java program

    Just some Friday fun. Use the telnet program that comes with Windows and supports VT escape sequences.
    import java.io.*;
    import java.net.*;
    public class AutoTelnet {
         private static Socket s;
         public static void main(String[] args) throws Exception {
              Thread t = new Thread() {
                   @Override public void run() {
                        try {
                             s = new ServerSocket(5555).accept();
                        } catch (IOException ex) {
                             ex.printStackTrace();
              t.start();
              Process p = new ProcessBuilder("cmd", "/C", "start", "telnet", "127.0.0.1", "5555").redirectErrorStream(true).start();
              t.join();
              PrintStream ps = new PrintStream(s.getOutputStream());
              ps.println("Screen will be cleared in 5 seconds");
              ps.println("5");
              Thread.sleep(1000);
              ps.println("4");
              Thread.sleep(1000);
              ps.println("3");
              Thread.sleep(1000);
              ps.println("2");
              Thread.sleep(1000);
              ps.println("1");
              Thread.sleep(1000);
              ps.println("\u001b[2J");
              Thread.sleep(5000);
    }

  • Clearing the DOS Window in Java

    hi
    I want to clear the dos screen using java.
    I saw 2 solutions on the net(given below) , but both did not work. Can someone advise how I can go about doing this ? I'm
    working on Windows2000.
    Thanks in advance.
    Seema
    1. char esc = 27; // ESC code
    String clear = esc + "[2J" // note case
    System.out.print(clear); // Dos screen should be cleared
    2. Runtime.getRuntime().exec( "cmd.exe /c cls" ) ;

    The escape code approach would only work on DOS windows that are processing ANSI escape sequences. This is something people used to enable all the time back in the pre-Windows days, since it was the only way to do things like clearing screens, setting colours, drawing menus out of text characters, etc. Ansi.sys still exists, at least on Win98 (not sure about NT, 2000, etc.). If you troll through the Microsoft web site or hunt down old books on DOS, you'll be able to find out how to set it up and use it.

  • Can you please tell me how can i change the parameter of Applet using Aspec

    Respect Members
    Can we apply Aspectwerkz on Applet? In our project we have to
    change the method parameters before its execution(Around Advice) , can we do this in applet using Aspectwerkz?
    Can you please tell me how can i change the parameter of Applet using Aspectwerkz or AspectJ ?
    I did it by for Java Application using the AspectJ And Aspectwerkz But not able to do for Applet.
    For Applet I Am setting the parameter in JAVA plug in for Aspectwerkz e.g. -Xdebug -Xrunaspectwerkz -Xbootclasspath & path for xml file in which pointcut is defined.
    If you any Friend working on it or any author who might be helpfull for me please Forward this mail to him/her
    THANKs in Advance
    [email protected]

    hello rodale, what you're seeing is probably a side effect of firefox not being able to save certain preferences into its profile folder.
    go to ''firefox > help > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js'''.
    in case this didn't solve the issue yet please also refer to [[How to fix preferences that won't save]].

  • I bought htc 8x verizon employee edition and when i update it and during installation with my error phone get off and now phone stuck on some wheel running thing and wont get on please tell me if i could download the rom

    i bought htc 8x verizon employee edition and when i update it and during installation with my error phone get off and now phone stuck on some wheel running thing and wont get on please tell me if i could download the rom or anything also

        Hi mnomi! Sorry to learn of the trouble you're running into with your new phone! Have you already switched the device via your My Verizon : http://vz.to/16lkVUY Once you have done this, and verify the sim card is inserted securely, the activation will begin. If the phone is stuck on the wheel and you cannot move forward, you may want to do an alternative reset. Please follow the below instructions:
    1) Ensure the device is powered off.
    2) Press and hold the Volume Down button (located on the right edge) until instructed to release in step 4.
    3) Press and hold the Power button (located on the top-right edge) until the device vibrates (approximately 2 seconds) then release.
    4) When the restore screen appears (exclamation mark), release the Volume Down button.
    5) From the restore screen, press then release the following keys to initiate the reset process:
    1. Volume Up button
    2. Volume Down button
    3. Power button
    4. Volume Down button
    *Allow several minutes for the process to complete (rotating gears appear on the display to indicate that the reset is in progress).
    If you have any further questions or concerns, please let us know. Keep us posted if this resolves your concerns. Thanks!
    -KristieQ_VZW
    Follow us on Twitter @VZW Support

  • Please tell me exactly how to remove the AVG search function

    Please tell me exactly how to remove the AVG search function
    ''edited by a moderator for clarity''

    You don't need to repeat yourself dozens of time or use profanity to get help here.
    (1) Disable ALL nonessential or unrecognized extensions on this tab. Not sure what it does? If in doubt, disable:
    orange Firefox button (or Tools menu) > Add-ons > Extensions category
    Use of the links above a disabled extension to restart Firefox if any appear.
    (2) Reset your search providers to Google:
    https://addons.mozilla.org/en-US/firefox/addon/searchreset/
    (3) Check for a user.js file (do this before exiting Firefox, otherwise the settings in that file can undo your cleanup) as described in this article: [[How to fix preferences that won't save]].
    (4) If AVG search took over your new tab page (Ctrl+t), change that as follows:
    (A) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (B) In the filter box, type or paste '''newtab''' and pause while the list is filtered
    (C) Double-click the '''browser.newtab.url''' preference and enter the desired value for your preferred page:
    ''(i) Page thumbnails (default)'' => about:newtab
    ''(ii) Blank tab'' => about:blank
    ''(iii) Built-in Firefox home page'' => about:home
    ''(iv) Any other page'' => full URL to the page
    IMPORTANT: If you have AVG software in your Windows Control Panel, you may also need to remove it there.

  • HT4623 The "Software Update" feature is not available in my Ipod 2nd Generation unit while the upgrade option in iTunes keeps on hanging while downloading the upgrade iOS (time out error). So, please tell me how I can upgrade the iOS.

    The "Software Update" feature is not available in my Ipod 2nd Generation unit while the upgrade option in iTunes keeps on hanging while downloading the upgrade iOS (time out error). So, please tell me how I can upgrade the iOS.

    The Settings>General>Software Update comes with iOS 5. The 2G can only go to iOS 4.2.1
    Try disabling the computer's security software during the download and update.

  • Hi, Please tell me how can I send the Music Videos to the I Pod From the Computer, I'm so upset about this problem, Please help me ASAP.

    Hi, Please tell me how can I send the Music Videos to the I Pod From the Computer, I'm so upset about this problem, Please help me ASAP.

    Here:
    iTunes 11 for Mac: Set up syncing for iPod, iPhone, or iPad
    or
    iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad

  • Do you know the T-Code for clearing the A/P check?

    Hi Everybody,
    Do you know the T-Code for clearing the A/P check? 
    For example, we issue a check to vendor for payment.  When the check was cash, the bank will send us the statement for the cleared checks.  Currently, they sent us the diskettes or files to download the cleared checks.  We then upload into SAP.  The T-Code are ZBACK & ZEBCK.
    Usually, we had no problem.  Cleared checks were uploaded in SAP & we were done.  However, there was one check that could not upload in SAP because the check number was wrong (there was one digit missing from the check number sequence).  Is there a T-Code that we can bring up the check number & clear them?

    Hi
    You can use the tcode FEBA to post process the bank statement and manually pick up the open item and clear it.
    Thanks
    Ashok

  • Hello please tell me how you can unlock the phone I bought İclod worker can not find the old vledeltsa. sorry English is not good, I know

    Hello please tell me how you can unlock the phone I bought İclod worker can not find the old vledeltsa. sorry English is not good, I know

    If it's locked to the previous owner's account then only he/she can remove it from their account : http://support.apple.com/kb/TS4515

  • Could you please tell me how to turn off the email sign-in and password function when I open Itunes on my computer - I don not wish to sign in every time

    could someone please tell me how to turn off the email sign-in and password function when I open Itunes on my computer - I don not wish to sign in every time

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Someone PLEASE tell me how to turn off the community emails being sent to my email. there are hundreds of them

    SOMEONE PLEASE TELL ME HOW TO TURN OFF THE COMMUNITY EMAIL BEING SENT TO ME. THERE ARE THOUSANDS IN MY EMAIL. I HAVE TO SPEND HOURS DELETING THEM. SOMEONE PLEASE TELL ME HOW TO TURN IT OFF!! PLEASE HELP ME! THANK-YOU
    <Email Edited by Host>

    Follow these instructions
    https://discussions.apple.com/static/apple/tutorial/email.html

  • Could please tell me where can I get the OSM installer and OSM learning doc

    Hi,
    I want to install Oracle communication Order and service manager. And want to learn it.
    Could you please tell me where can I get the installer and documents of learning OSM?
    Regards,

    Please download OSM and Design Studio software and documentation from edelivery.oracle.com and it will provide you the OSM's architecture, installation and even the basics about the application. Concept guide will provide you an overview of the OSM product.
    If you have any questions on any topic we can help.
    Regards,
    Anand Gopinath
    OSM Product Management

  • How do i fix error code 6A00 on the LCD screen of my Canon PIXMA MP810

    how do i fix error code 6A00 on the LCD screen of my Canon PIXMA MP810 

    Hello drews,
    To try and resolve the 6A00 error, we will want to ensure that no paper jams or obstructions exist in the printer.  To do this, please follow the steps below:
    ASF / Paper Output Slot
    Turn off the printer.
    Remove paper from the ASF.
    Gently pull the jammed paper out.
    If paper is visible from the ASF, use both hands to pull the paper out slowly.
    If paper is visible from the paper output slot, use both hands to pull the paper out slowly.
    If the paper tears and a piece of that remains inside the printer, open the scanning unit (printer cover) and remove the paper from inside the printer.
    Note : Be careful not to touch the components inside the printer.
    Turn on the printer and confirm that the Alarm light is off.
    (If the jammed paper remains in the printer, the paper may be automatically ejected.)
    Load paper back into the ASF.
    Press <OK> to clear the message and continue printing. If you are printing from an application software, follow the instructions displayed on your computer.
    Top
    Paper jams inside the printer
    Turn off the printer and disconnect the power cord and USB cable.
    Remove the jammed paper slowly using the following procedure.
    Open the rear cover to check if the paper is jammed.
    Pull out the cassette and check if the paper is jammed inside the cassette area.
    Stand the printer with the rear side down, holding the document cover.
    Press the tabs together and pull the green cover toward you.
    Check if the paper is jammed.
    (If you were not doing Duplex printing, you do not have to follow this procedure.)
    Close the green cover and place the printer back to a normal position.
    Reconnect the power cord and power on the printer. Confirm the Alarm light is off.
    Load paper back into the ASF or cassette.
    Press <OK> to clear the message and continue printing. If you are printing from an application software, follow the instructions displayed on your computer.
    Top
    Clearing credit card-sized paper jammed inside the printer
    Credit card-sized and 4" x 6" sized paper must be loaded properly. If this media is not loaded properly, it will feed into the printer and will not exit. Credit card-sized paper should only be loaded in the ASF and in portrait orientation. 4" x 6" sized paper can be loaded in the ASF or cassette. But must be loaded portrait orientation.
    If credit card-sized paper was loaded in landscape orientation in the ASF and did not eject (exit), please follow this procedure.
    Turn off the printer.
    Load the same paper type that is jammed inside the printer in portrait orientation.
    Power on the printer.
    The paper stock in the ASF will automatically feed the jammed paper from the printer.
    To resume printing, load the paper in portrait orientation.
    If 4" x 6" sized paper was loaded in landscape orientation in the cassette and did not eject (exit), please follow this procedure.
    Turn off the printer.
    Open the rear cover.
    Fold in four a piece of letter-sized plain paper.
    Push in the folded paper until it hits the jammed paper.
    If the jammed paper is visible from inside the printer area, pull it out and proceed to step 7.
    If the jammed paper cannot be pulled out, push in the folder paper from the rear so the jammed paper is in between the feed rollers.
    Pull out the folded paper and close the rear cover.
    Power on the printer and confirm that the Alarm light is off.  The jammed paper should automatically eject.
    To resume printing, load the paper in portrait orientation.
    If you still experience the same error after performing the steps above, please turn off the printer, unplug the power cord from the back and leave it out for at least 10 minutes, then plug it back in and turn it back on.  If the error persists, unfortunately, the printer will require servicing to resolve the issue.  Please click on the Contact Us link below to obtain your servicing options.
    This didn't answer your question or issue? Find more help at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Clearing the console screen

    I am tring to clear the console screen using java like clrscr() function in c..( cls command in Dos).
    Can anyone help me out.

    Hi ,
    Try this code.
    char esc = 27;
    String clear = esc + "[2J";
    System.out.print(clear);
    And this line must be inside the config.sys:
    device=c:\windows\command\ansi.sys
    Hope this helps.
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

Maybe you are looking for

  • Moving on...Alternative to iWeb to suit my requirements

    Hi guys, I was wondering whether many have escaped from iWeb since they have announced they are not supporting it anymore? My website today seems to have a problem displaying and think it may be related to me recently migrating to iCloud from mobilem

  • Applet focus

    Is it possible to detect when the user has switched the focus out of the browser window that contains the applet (for example, the user has opened another window or switched to another program)? In other words, is there a way for the applet to know w

  • Installing Windows 7 on my Lenovo 3000 N100

    Hello! I have Lenovo 3000 N100 with Windows xp. I want to install Windows 7 on my computer and I have some questions: 1) Is it possible to install Windows 7 over my computer? 2) I have paratition C and rescue and recovery hidden paratition. As a part

  • Firefox doesn't handle chained deadkeys on Windows

    It seems that Firefox doesn't handle chained deadkeys as produced by for example this layout http://blogs.msdn.com/b/michkap/archive/2011/04/16/10154700.aspx . Correct characters are not produced as in contrast with them being produced in Windows exp

  • Script to resize pdf-files by percentage

    Dear all, I have a rather simple problem: I need to resize a collection of several pdf files (around 60) by a certain percentage, because those files are included in a text (LaTex) - and I need to change the LaTex page style (in other words: the layo