Is it possible to run all Dos based command on Java ?

hello friends
I run Dos Commands on Java by following code
try{
Process p=Runtime.getRuntime().exec(new String[]{"cmd.exe","/c","dir"});
}catch(Exception e){e.printStackTrace();}
System.out.println("bye");
If I run "mkdir" instead of "dir" folder is created in current directory. But in case of "dir" listing of file folders is not displayed to me . means "dir " is not running.
could any body tell me what to do in this case
thanks

ejp wrote:
'dir' is not an executable program. It is built-in to the command shell. The only way you can execute it is by feeding it to a shell via a batch file.Sorry 'ejp' but 'dir' can be run this way (I have just checked on XP) so there has to be something wrong with the way the OP is processing the results. Since he does not seem to process stdout or stderr and he does not wait for the process to complete I am betting he is falling foul of one or more of the traps. My best bet is that he is expecting a console window to open and the directory listing to appear in it.

Similar Messages

  • Is it possible to run this Oracle based application ???

    Hello All,
    I have Oracle Forms/reports 9.0.4.1.0 installed on my windows XP.
    I am running Oracle based application from this box.
    here is the url for it:
    http://localhost:8889/forms90/90servlet
    Is it possible to run this Oracle based application on different PC on network through above URL?
    If yes, how to configure or set up this.
    Regards,
    DN

    From port number I assume you're using Developer suite. Remember that standalone OC4J is provided by Oracle for testing purposes only. You shouldn't use that in Production environment, where you should install Application Server, eventually the standalone Forms and Reports services (without infrastructure).

  • Is it possible to run Acrobat3D from the command line?

    I'd like to know if it is possible to run Arobat3D from the command line in batch mode. I'm interested in knowing if this is possible in either a windows or unix environment.
    My objective is to convert CAD data e.g. CATIA V5 or DXF etc to PDF, in batch mode without using the Acrobat3D interface itself.
    I know that it's possible to run a batch process from within Acrobat3D itself, therefore one solution may be to invoke those batch processes from the command line.
    I've looked through the other listings on this forum and seen this question asked previously, but I've not seen any responses that suggest this is even a feasible concept.

    As of now, it's not possible in the cmd-mode to just remain connected and not stream.
    But the reason you want to do that is because of the long start-up time. That 20 sec time can be divided into:
    1. launch time
    2. time to start encoding (after pressing start button) -> cannot be reduced even if 'connected only' feature is available in cmd-line
    Below are tips you can use to reduce this 20 sec of time:
    1. Lesser the no. of devices connected to the system, shorter is the launch time. Disable the devices which are not to be used in the session.
    2. Try using device indexes (0, 1, 2, etc) instead of device names in the profile. Indexes might change after you disable some of the devices.
    3. Use the profile with correct settings, to avoid any validation errors.
    4. Higher the video size, higher is the overall time. Small sizes take lesser time to start.
    Let me know if you see any improvement in the startup time.

  • Running a SQL*Plus command from Java

    I have a requirement to run SQL* Plus commands from Java. The results as they would appear in SQL*Plus window or spool file should be captured and stored in a table.
    For example,
    SQL> select * from dual;
    D
    X
    1 row selected;
    SQL>
    All the lines above should be stored for later use.
    Could any one give pointers?
    Thanks,
    Ravi

    <p>
    Hi,
    </p>
    <p>
    <strong><font face="Courier New">
    public class RuntimeExecApp {
     public static void main(String args[]) throws IOException
      Runtime r = Runtime.getRuntime();
      r.exec(&quot;C:\\Oracle\\sqlplus.exe&quot;);
    }</font></strong>
    </p>
    <p>
    Kuba 
    </p>
    Message was edited by:
    KUBA

  • Is it possible to run all OS and programs on Mountain Lion?

    Greetings!
    I have set myself the following challenge and wondered if it was technically possible to do the following:-
    On a single mid-2012 MacBook Pro (with optical drive built in) running OS 10.8.5 as the main OS and obviously totally within the law of my country I would like the ability to run:
    § Power PC applications;
    § All Mountain Lion programs;
    § Any Linux program;
    § Windows 7 or later;
    Note 1: I have already purchased Mac OS Snow Leopard Server and await it's delivery…
    Note 2: I am happy to buy an OEM copy of Microsoft Windows…
    Note 3: Microsoft Windows is sadly a necessity due to my University not supporting anything else for it's specialist software which I require for my studies.
    Note 4: I would use Ubuntu Linux
    Note 5: I have absolutely no desire to ever run Mavericks at all…
    Thus, I would like my MacBook Pro to simply run any program I care to use, is this realistically possible?
    Please accept my apologies if this is posted in the wrong section, I was a little unsure in which community to post this.
    Thank you in advance,
    CK

    Thank you,
    I shall do just that, as soon as I've purchased an OEM of Microsoft Windows…
    Is there anything I should be aware of, other than to keep a back up of everything before I start, please?

  • Is it possible to disable all web based features when no wifi is available?

    I'm interested in buying a Firefox phone but I only what to use web based services when a wifi connection is given because my cell phone contract does not cover internet usage properly. Is this possible?

    No, not really.  I can't take you up on your advice and use delegates.  The use case excludes PC all together - there is no computer nearby to be used.  In my case they need to make and receive phone calls, be able to transfer calls, and have
    a voice mail feature.  Lync Edition device does not accommodate this use case well.  Here are the issues so far.
    1. You can't transfer calls unless phone is unlocked.  There is a way to change that trough policy, but the phone lock policy works on per site basis.  On a small deployment like ours with a single site this means phone lock for everyone or no
    one. 
    2. Phone shows error about "Exchange integration" as we discussed above.  Due to interface design choices this means that "menu" button is obscured form view.  That makes it impossible for uninformed user to transfer a call.
    Here is the bottom line the way I see it: the Lync Edition Phone is great for an office (cubical farm) environment, but when time comes to deal with special use cases the assumptions Lync/Exchange team made backfire.  I'd have to go to Lync Server compatible
    phone like Polycom VVX to get around phone lock issue.  In Polycom world that is configurable on per phone basis, as, one would argue, it should be.  Polycom have bugs of their own though - you can't make "blind transfer" a default method of transfer. 
    So, no good solution so far.

  • Running a DOS program before an ABAP program

    Hello
    we have Z_Order  ABAP program which load order to SAP, we need to run a DOS program to get file to the correct folder.
    Is it possible to run this DOS program every time user run Z_Order program
    Thanks

    Hello Mohsen,
    welcome in the SAP community.
    If you don't have the possibility to change your ABAP report Z_Order you can do this:
    Download the COM Connector from here. Look at example 0108_ABAPReport.vbs. It is a VBScript to implement and execute and ABAP Report via VBScript. Change the report inside the VBScript like this:
    Dim ABAP(2)
    ABAP(0) = "Report z_myreport Line-Size 256."
    ABAP(1) = "Submit Z_Order."
    Now write a batch file like this:
    MyDOSProg.exe
    wscript.exe 0108_ABAPReport.vbs
    In the first step your DOS program is executed and in the second step the VBScript implements and executes the ABAP program to run your Z_Order report. You can start your batch file from your presentation server. But you need one the one hand rights for RFC connection and on the other hand a developer key.
    Another way is to go to your developer and talk to him about a RFC function module, which calls the report Z_Order via Submit. Now you can call this RFC function module as in the CCo example 0103_Ping.vbs as I described above. Here you need only the rights for RFC connection.
    If you have the possibility to change your ABAP report, you can do that:
    Call Method cl_gui_frontend_services=>execute
      Exporting
        DOCUMENT = 'cmd MyDOSProg.exe'
        SYNCHRONOUS = 'X'
      Exceptions
        Others = 1.
    Call the method execute in front of all other commands inside your Z_Order report.
    Cheers
    Stefan

  • Can i run all the SQL And PL/SQL in Oracle SQL Developer?

    hi all
    I have heard that Oracle Sql Developer is a free editor for Oracle DB from Oracle.
    Is it possible to run all the the procedres and functions in that editor
    is there any limitation for that ,can i run all the things that we can run on the SQL Plus
    if anybody knows please let me know
    thanks & regards

    Interesting way of putting it.
    When it comes to SQL and PL/SQL, SQLPlus and SQL Developer do not really 'run' very much.
    Most of the time, these things are just shells that pass the SQL and PL/SQL requests to the appropriate engine (database) which will run the command.
    The challenges are:
    - will the shell interpret the request as something to pass to an engine?
    - will the shell display the response from the engine appropriately?
    For answers to those questions, TongucY provided approriate links.

  • Running multiple unix commands form java

    hi i have a probelm when i am trying to run more than one command from java:
    i want to run it by using bin/ksh -c (this will take the first arg so i have probelm with runnig commad like" less abc.txt)
    commands to be run:
    1- ll -tr
    2-mkdir x
    3-less abc.txt
    Runtime rt = Runtime.getRuntime();
    Process pr = rt.exec("/bin/ksh -c ll;pwd;less abc.txt");
    which commands i am allowing to run form the java and how can i make it
    best regrdas
    Thanks in advance.

    eddie100 wrote:
    hi i have a probelm when i am trying to run more than one command from java:
    i want to run it by using bin/ksh -c (this will take the first arg so i have probelm with runnig commad like" less abc.txt)
    commands to be run:
    1- ll -tr
    2-mkdir x
    3-less abc.txt
    Runtime rt = Runtime.getRuntime();
    Process pr = rt.exec("/bin/ksh -c ll;pwd;less abc.txt");
    which commands i am allowing to run form the java and how can i make it
    best regrdas
    Thanks in advance.put your commands in a shell script and then call the script from java ...
    import java.io.*;
    class Runner {
            public static void main(String[] argv) throws Throwable {
                    Process p = Runtime.getRuntime().exec("/export/home/caleb/c_code/t.sh");
                    BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
                    String line;
                    while( (line=br.readLine()) != null ) System.out.println(line);
    }

  • Is it possible to run dos-command's in java?

    I have a small security problem. I have a dos-based java prog. with login at the start og the program, but I have problems hiding the password. I have managed to hide the password when it is typed, but when you press enter and get to the next menu, it is only to press the up-key, and dos recover the last typed sentence. (The password...) I have been able to fine the dos-command "doskey /reinstall", which will clear the memory, but I haven't been able to implemet this in my java-prog.
    Any tips/trics are appreciated.

    I have a small security problem. I have a dos-based
    java prog. with login at the start og the program, but
    I have problems hiding the password. I have managed to
    hide the password when it is typed, but when you press
    enter and get to the next menu, it is only to press
    the up-key, and dos recover the last typed sentence.
    (The password...) I have been able to fine the
    dos-command "doskey /reinstall", which will clear the
    memory, but I haven't been able to implemet this in my
    java-prog.
    I doubt that calling that in your program would help.
    doskey is specific to the process. Running it by any means in java means that a new process will exist. You can verify this by open two console windows and running doskey in both. Nothing that you do in one will be reflected in the other.
    I don't think your problem is a program problem. That means that it should not be solved by software but rather by management. For example you certainly wouldn't expect your program to make sure that someone wasn't standing behind the user when they typed their password right? And what if someone installs a key grabber on the computer? In that case any program, yours included, would have all the key presses logged to a file.
    Alternatively if you might be able to solve it with one of the following...
    - Recode the application to use a GUI. If there is no console the doskey isn't going to get anything.
    - Write some JNI that bypasses the java input handling. If you handle the input directly then you can turn off echo
    - Inspect the java source code for the VM. There might be a hidden method to turn echo off. Alternatively you can find the code responsible for this, modify them, and use them with the bootclass option to replace the ones in the VM. This solution is not distributable. And it might not be possible solely using java.

  • Is it possible to run a command prompt(or DOS Command) through flash and run a Activex(.OCX) file from flash

    Hi all
        Is it possible to run a command prompt(or DOS Command) through flash.If it possible please guide me to do that throug AS 3.0.
       and
    Is it Possible to run a activex (.OCX) file from flash. If it is so please guide me the way to do it
    Thanks and Advance
    Sankar.M.S

    Or create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).

  • Is it possible to run a command prompt(or DOS Command)  and Activex File(.OCX)

    Hi all
    Is it possible to run a command prompt(or DOS Command) through flash.If it possible please guide me to do that throug as 2.0. and is it possible to run a Activex File(.OCX) through flash.
    Thanks and Regards
    Sankar.M.S

    Or create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).

  • Is it possible to run test suite B based on test Suite A?

    There are 2 test suites:
    A & B
    I want to run the test suite B only when test suite A is successful.
    Please give me some hints how to achieve this.

    There isn't any official way to do this at this time. Pre-release we supported this but tools like FlashBuilder and some other interface points needed to know, before the testing began, how many tests they were expecting and that sort of derailed us.
    However, if you want to know how to do this in a quick and dirty sort of way, and you don't mind doing a little work, here is an approach you can refine.
    First, create yourself a static class or a singleton which implements IRunListener. Objects of this type can receive updates as tests run, fail, etc. So in your object you could keep track of any failure conditions which were important decision points. Call the addListener() method of the FlexUnitCore and pass your object in.
    var core:FlexUnitCore = new FlexUnitCore()
    core.addListener( mySpecialSingletonListener.getInstance() );
    This will register your object to receive the updates I mention above. Next step, create a new runner which extends Suite. So, for example PotentiallyIgnoreMeRunner extends Suite.
    Inside of here you are going to add a new function which I have provided here called ignoreRecursively:
    protected function ignoreRecursively( notifier:IRunNotifier, description:IDescription ):void {
      if ( description.isTest ) {
        notifier.fireTestIgnored( description );
      } else {
        var children:Array = description.children;
        for ( var i:int=0; i<children.length; i++ ) {
          ignoreRecursively( notifier, children[ i ] );
    Basically, it will cause each test in this suite to be marked as ignored in the output and will not execute it.
    Then you will need to override the protected runChild() method to do something like this:
    override protected function runChild( child:*, notifier:IRunNotifier, childRunnerToken:AsyncTestToken ):void {
      var mySpecialSingleton:MySpecialSingleton = MySpecialSingleton.getInstance();
      //Here you will need to call some function that accepts the current testClass and decides if it should be run or ignored
      if ( mySpecialSingleton.shouldIRunThisSuite( testClass ) ) {
        super.runChild( child, notifier, childRunnerToken );
      } else {
        var description:IDescription = describeChild( child );
        ignoreRecursively( notifier, description );
        childRunnerToken.sendResult();
    Almost done, decorate your suite classes to use your new runner instead of ours:
    [Suite]
    [RunWith("some.package.PotentiallyIgnoreMeRunner")]
    public class SuiteB {
    Finally, make sure you include a reference to the PotentiallyIgnoreMeRunner somewhere in your application. Metadata is just a string to FlashBuilder and it will not automatically know to include the PotentiallyIgnoreMeRunner in the final swf file.
    I just did a quick prototype and it will successfully ignore all tests based on the result of another.
    Mike

  • I can't upload a copy I got of Adobe Photoshop CS on my Mac Mini OS X 10.5.8. All I can get for why is this  "This program cannot be run in DOS mode" I have no idea what this means?

    I can't upload a copy I got of Adobe Photoshop CS on my Mac Mini OS X 10.5.8. All I can get for why is this
    "This program cannot be run in DOS mode"
    I have no idea what this means?

    Are you certain the copy of Adobe Photoshop CS is for the Mac OS, not Windows?

  • I have a PPC based software ... Is it possible to run it in intel based?? I have a iMAC OS X Snow Leopard 10.6.8.  Thanks

    I have a PPC based software ... Is it possible to run it in intel based?? I have a iMAC OS X Snow Leopard 10.6.8.  Thanks

    Their answer was this ...
    The version for GNX4 MACOSX is only for PPC based Mac. There is no Intel version as the product was discontinued before Intel based MAC came out.
    I guess I should give up, hehehe...
    Thanks

Maybe you are looking for