How to get no. of rows of Windows Command Prompt in java

hi all,
can anybody tell me that is there any java utility avalilable throght I can find the how many rows avalilbe on currently executing command prompt, and also how can i clear the content of command prompt (result of 'cls' command).
Currently execting command prompt means from where I have run my java program.
any reference is also welcome.
thanks in advance.

Clearing the screen is trivial, as long as you're OK with making your program specific to Windows only (i.e. you never hope to run it on any other OS ever):
Runtime.getRuntime().exec("cmd /c cls");As to figuring out how many lines your command window's screen buffer has - good luck with that. I'm not familiar enough with the Win32 API to get this info, but you'll have to figure out what that is, and call it via JNI.

Similar Messages

  • Manipulating Windows command prompt through Java

    I am wondering if there is any way to manipulate simple Windows command prompt commands like color, cd, dir, cls through a java application. Any help or informative redirection would be much appreciated.

    BinaryBurnout wrote:
    I am wondering if there is any way to manipulate simple Windows command prompt commands like color, cd, dir, cls through a java application. Any help or informative redirection would be much appreciated.Realize that the Windows command prompt is an application (cmd.exe), and those commands are specific to that application.

  • How to get a single row column from a viewobject in java?

    I have a class file that goes out and gets a viewobject and sets its where clause
    this is it:
    vcRow = vc.createViewCriteriaRow();
    vcRow.setAttribute("LogonId", "='" + strPcis_Login.toUpperCase() + "'");
    vc.addElement(vcRow);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    I know this working cause I can watch it in debug..
    but now the problem.
    I've looked in the docs and don't see how one can pull the value of the row it found and place it in a uix page in a textinput area
    how can I get a single row column, in this case the UserName that is in the view object to a string and then place it into my
    uix page? I've looked and looked and don't see a method for this.
    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented?

    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented? What you can do is get the value from your VO and set it somewhere that UIX can data bind to -- as a Page proprety, on HttpSession, etc. This is documented in Chapters 4 (Data Binding) and 5 (Controller) of the UIX Developer's Guide.
    To set a property, you use Page.setProperty(String key, String value). Then, in your UIX file, to make a textInput that has the value pulled from a given page property, use:
    <textInput data:text="key@ctrl:page" />
    -brian
    Team UIX

  • How to get rid of "Warning: Applet Window" in third party java applet code

    Hello I am having a hard time figuring out how to disable this darn Warning applet window that pops up and says "unable to detect an audio device" when it loads onto a comp that has no sound card! It is an audio streaming applet which was discarded by the developer and he does not provide any support for it....
    I know zero about java and I am figuring this is something simple that any typical programmer familiar with java could figure out in five minutes.....
    the applet is called audio centric and is located here:
    http://javaboutique.internet.com/AudioCentric/
    I appreciate anyones time who could help me out!

    Sorry, there is not source code deployed and I'll not encourage you to decompile it, instead contact developer. They will appreciate very much your claim.
    Regards.

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to get number of rows return in SELECT query

    i'm very new in java, i have a question:
    - How to get number of rows return in SELECT query?
    (i use SQL Server 2000 Driver for JDBC and everything are done, i only want to know problems above)
    Thanks.

    make the result set scroll insensitve, do rs.last(), get the row num, and call rs.beforeFirst(), then you can process the result set like you currently do.
             String sql = "select * from testing";
             PreparedStatement ps =
              con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
             ResultSet rs = ps.executeQuery();
             rs.last();
             System.out.println("Row count = " + rs.getRow());
             rs.beforeFirst();~Tim
    NOTE: Ugly, but does the trick.

  • How to get a unique row in a value set

    How to get a unique row in a value set which is used in concurrent program.
    Example if a table contains 10 unique rows i need only one row to show.
    Thanks

    add conditions in where clause to supress the duplicate values.
    On how to supress the duplicate values follow the link
    http://oracleschools.com/index.php?topic=40.msg76#msg76
    Thanks
    Prudhvi
    www.erpschools.com

  • How to get carrier company name on windows phone 8.1?

    how to get carrier company name on windows phone 8.1?

    excuse me, i referrer the link http://stackoverflow.com/questions/26973111/get-carrier-name-cellular-mobile-operator-name-using-windows-phone-8-1 to
    modify my universal app.
    but i always get 0 count from the GetNetworkNames() method. 
    if my sim card is for 3G, but i setting 4G in highest connection speed. i got the "the pipe is being closed".
    how can i solve the problem? thank you.

  • How to get Caps lock indicator in windows 8.1

    How to get Caps lock indicator in windows 8.1   ???
    i am using wireless keyboard KG 1061

    Hi bhargav0,
    I understand you would like a caps lock indicator in Windows 8.1. I admit, I don't know of any fix that simply shows you on the screen, but there is an auditory warning that you can implement if that would be of help to you. Take a look at the following video, Windows® 8.1: Make the Caps Lock key beep when pressed. I hope this will be of use to you. Have a great day.
    Ryan1216
    I work on behalf of HP
    The advice and opinions given here are my own and not those of HP

  • HELP!! How to get the position of active windows in the desktop

    How to get the position of active windows in the desktop

    You mean, active windows other than the program you're running, or windows the program puts there? And a real desktop (like where MyComputer is), or a desktop pane?

  • How to get count of rows for a table?

    Hi,
    How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
    Regards,
    Devashish

    Hi Devashish,
    WdContext.node<Your_node_name>().size() will give you the no: of rows.
    This should be the node that is bound to the table's datasource property.
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
    You can access an attribute of a particular row as
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • HT1589 This doesn't work in Windows 8. Anybody know how to get this dialog box in Windows 8?

    This doesn't work in Windows 8. Anybody know how to get this dialog box in Windows 8?

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • How to execute a scenario from Windows command prompt

    Hi,
    I have a package which is executing fine from Designer. But the same scenario if I am trying to execute from windows command prompt, then it is giving error.
    The package is getting a refresh variable, passing to interface which is creating a file from table, this file is then getting FTP'ed to another server.
    I am executing following command -
    startscen OB_TAB_TO_FILE_PKG 001 ODICTX "-v=2"
    The error is -
    A JDK is required to execute Web Services with OracleDI. You are currently using
    a JRE.
    OracleDI: Starting scenario OB_TAB_TO_FILE_PKG 001 in context ODICTX ...
    java.sql.SQLException: socket creation error
    at org.hsqldb.jdbc.jdbcUtil.sqlException(jdbcUtil.java:67)
    at org.hsqldb.jdbc.jdbcConnection.<init>(jdbcConnection.java:2451)
    at org.hsqldb.jdbcDriver.getConnection(jdbcDriver.java:188)
    at org.hsqldb.jdbcDriver.connect(jdbcDriver.java:166)
    at com.sunopsis.sql.SnpsConnection.u(SnpsConnection.java)
    at com.sunopsis.sql.SnpsConnection.c(SnpsConnection.java)
    at com.sunopsis.sql.i.run(i.java)
    DwgJv.main: Exit. Return code:-1
    Please let me know where I am going anything wrong.
    Thanks,
    Himanshu

    Hi,
    you need to make the necessary changes to the %odi%\bin\odiparams.bat config file, under the "Repository Connection Information" section so that startscen knows how to extract metadata from your repository.
    You apparently have left the default settings to the Hypersonic demo repository. Is that the technology your repository is hosted on?

  • Unable to connect to database from windows command prompt

    Hi All,
    Im trying to connect to Oracle database from my windows command prompt, these are the steps I followed:
    1) cd C:\oracle\product\11.2.0\client_1\sqlplus
    2) sqlplus username\password@hostname:1521\service_name
    I do get the error ORA-06401: NETCMN: invalid driver designator
    I did try using the SQLPLUS \NOLOG
    Connect username\password@hostname:1521\service_name
    I still get the same error.
    I did manually type all the commands to make sure no additional charaters coming and etc...How shall I overcome this...

    user9103174 wrote:
    Hi All,
    Im trying to connect to Oracle database from my windows command prompt, these are the steps I followed:
    1) cd C:\oracle\product\11.2.0\client_1\sqlplus
    2) sqlplus username\password@hostname:1521\service_name
    I do get the error ORA-06401: NETCMN: invalid driver designator
    I did try using the SQLPLUS \NOLOG
    Connect username\password@hostname:1521\service_name
    I still get the same error.
    I did manually type all the commands to make sure no additional charaters coming and etc...How shall I overcome this...do you desire/plan on using EZCONNECT or tnsnames.ora entry?
    EZCONNECT sample is below
    sqlplus user1/pass1@'dbserver:1521/orcl_sid'

  • How can I pass a value to the command prompt?

    I was wondering how can I pass a value to the command prompt with Windows and Linux? I'm more interested in Linux's system than Windows though. Is there a way to return info from the command prompt?

    Here is a snippet from http://mindprod.com/jglossexec.html that explains how in detail.
    Runtime.getRuntime().exec("myprog.exe") will spawn an external process that runs in parallel with the Java execution. In Windows 95/98/ME/NT/2000/XP, you must use an explicit *.exe or *.com extension on the parameter. It is also best to fully qualify those names so that the system executable search path is irrelevant, and so you don't pick up some stray program off the path with the same name.
    To run a *.BAT, *.CMD, *.html *.BTM or URL you must invoke the command processor with these as a parameter. These extensions are not first class executables in Windows. They are input data for the command processor. You must also invoke the command processor when you want to use the < > | piping options, Here's how, presuming you are not interested in looking at the output:
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat" );
    Runtime.getRuntime( ).exec ("cmd.exe /E:1900 /C MyCmd.cmd" );
    Runtime.getRuntime( ).exec ("C:\\4DOS601\\4DOS.COM /E:1900 /C MyBtm.btm" );
    Runtime.getRuntime( ).exec ("D:\\4NT301\\4NT.EXE /E:1900 /C MyBtm.btm" );
    There are also overloaded forms of exec(),
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat", null);
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat", null, "C:\\SomeDirectory");
    The second argument can be a String [], and can be used to set environment variables. In the second case, "C:\\SomeDirectory" specifies a directory for the process to start in. If, for instance, your process saves files to disk, then this form allows you to specify which directory they will be saved in.
    Windows and NT will let you feed a URL string to the command processor and it will find a browser, launch the browser, and render the page, e.g.
    Runtime.getRuntime( ).exec ("command.com http://mindprod.com/projects.html" );
    Another lower level approach that does not require extension associations to be quite as well set up is:
    Runtime.getRuntime( ).exec ("rundll32 url.dll,FileProtocolHandler http://mindprod.com/projects.html" );
    Note that a URL is not the same thing as a file name. You can point your browser at a local file with something like this: file://localhost/E:/mindprod/jgloss.html or file:///E|/mindprod/jgloss.html.
    Composing just the right platform-specific command to launch browser and feed it a URL to display can be frustrating. You can use the BrowserLauncher package to do that for you.
    Note that
    rundll32.exe url.dll,FileProtocolHandler file:///E|/mindprod/jgloss.html
    won't work on the command line because | is reserved as the piping operator, though it will work as an exec parameter passed directly to the rundll32.exe executable.
    With explicit extensions and appropriately set up associations in Windows 95/98/ME/NT/2000/XP you can often bypass the command processor and invoke the file directly, even *.bat.
    Similarly, for Unix/Linux you must spawn the program that can process the script, e.g. bash. However, you can run scripts directly with exec if you do two things:
    Start the script with #!bash or whatever the interpreter's name is.
    Mark the script file itself with the executable attribute.
    Alternatively start the script interpreter, e.g.
    Runtime.getRuntime( ).exec (new String[]{"/bin/sh", "-c", "echo $SHELL"}";

Maybe you are looking for

  • PO replication to R/3 from EBP in Extended classic scenarion

    Hi All,          We are using ECS for plan driven procurement and bidding engine in our system.presently we have configured the system in sand box.We can able to do the entire cycle like PR transfer from R/3 to Sourcing cockpit upto PO creation in SR

  • Wishlist for ipad

    I'd like very much a daap improvement in ipad... not only family sharing to share music!!! this is pathetic for a nas server support (daap!!!) thanks!!!

  • Error in Decision Table using Analytic View

    Dear experts, I am trying to create a Decision table on an Analytic view. As per the HANA document guidelines, the Analytic view has one Calc. Attribute, the Action is created from a Parameter and Conditions are created from Analytic View column. But

  • Function module RH_GET_MANAGER_ASSIGNMENT in MSS, HR Structural auth

    Hi, - Is function module RH_GET_MANAGER_ASSIGNMENT only valid when a personnel user is flagged as 'chief position' in HR Org model ? As this function module uses MANASS evaluation path and A012 (Manages...) as relationship, can it be used without men

  • Will only show the apple logo thats it I can do noithing else

    my ipod only shows the apple logo and willl not do anything else how do i fix it?