How to run a command line window from code?

In an application I need to run a dll file with a few arguements. These arguements can be given in the command line window. The execution of the dll file will return a string that i need to get (for the parsing etc).
1. How can I open a command line window from the Java code?
2. How to run commands on it?
3. How to get the results of the commands from the command line into my program?

In an application I need to run a dll file with a few
arguements. These arguements can be given in the
command line window. The execution of the dll file
will return a string that i need to get (for the
parsing etc).
A dll is used by other programs. It is not possible to run it from the command line.

Similar Messages

  • How to hide the command line arguments from solaris process

    Hi All,
    When I execute a JAR application from a java file using the Runtime.getRuntime, the command line arguments (user ID and Password details) which I passed for executing the application displayed on Solaris process (ps -ef).
    Could anybody please help me, how can I hide either the process or the command line arguments from the Solaris process?
    I cannot pass any asterix or any special character in place of password, because the executing application doesn't have any functionality to retreive the password which send as asterix characters.
    Please help me
    SumodeV

    Thanks for all the response.
    I have created a design and implement the functionality which executes the JAR application in Solaris environment without showing any details in the process details.
    I have used the Java Reflection method, which invokes the JAR application. I am sharing the details here for all those who looking for it.
    1, Inside the Customer application [Jar File is running for it], collect the necessary session details [Using System.get property method]
    2, Create an independent Java file, which should be used to invoke the JAR application
    3, Create the ProcessBuilder object and use a command - execute the Java file [a wrapper code] using normal Java command
    4, Pass the necessary session details to the ProcessBuilder using the environment() function.
    5. Collect the environment values in the independent Java file (Which was invoked by ProcessBuilder) and set details for its environment using System.setProperty.
    6, Use reflection technique to invoke the JAR plugin [which you want to run]. You can use the standard Java functionality to read the MANIFEST file of JAR and load the main class using URLClassLoader.
    7, Invoke the main method of the JAR file, which run the JAR application in Solaris window
    This solution will make sure that the process cannot display any session details in the Solaris Environment.
    Note: Use String[] array while create the command. Otherwise the JAR application cannot pop-up.
    Regards
    Sumode

  • How to run a command line argument

    i want to run a command line argument, say for eg......i want to execute the "dir" command on the dos prompt and capture the output.
    how can i do this.
    actually i want to capture the output of the ping command and write it to a file. can any body plsssssss help

    This command runs a ping to "address" and writes the output back to the command line. To capture it, just put strings into an array or do whatever you want with it. If you want to wait until the program completes before reading its input, use p.waitFor().
    Process p = Runtime.getRuntime().exec("ping " + address);
    BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String currLine = null;
    while((currLine = in.readLine()) != null)
      System.out.println("ping: " + currLine);
    [/code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to run using command line in oracle9i

    Hi there...I would like to know how do you a program using the command line in oracle9i JDeveloper...coz my program is processing the input typed from the user.How do you run in oracle9i Jdeveloper.

    errr Typed input would be done by typing in the console window...provided your java is waiting for keyboard input.
    If you mean as commandline parameter, then you need to modify your runtime configuration for the project.

  • How to run ADF command-line test-client on standalone weblogic host

    I have followed the steps to create a test client for the ADF application. In used the following link:
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/bcquerying007.htm
    The above link does not talk about how to setup the environment where the standalone weblogic is installed to be able to run the test client.
    I can run it in the jdeveloper environment.
    I can also run from the command line on the development host, by cut-paste the command from the jdeveloper output log tab.
    I am trying to run this client on the machine where we have a weblogic installed (standalone) for testing. We can run our ADF application from the browser with no issues. We want to automate and run some testing related to the ADF model (non-viewcontroller part) from the command line on this test stage.
    Which/Where are the ADF libraries?
    How can I add our application jar deployed on the weblogic (ear file) to the CLASSPATH?
    What other libraries ADF/Weblogic do I need for the command line test client?
    What am I missing?
    Thanks for any help.
    Edited by: mmunawar on Jul 2, 2011 1:03 PM
    Edited by: mmunawar on Jul 2, 2011 1:04 PM

    create weblogic application server connection from jdeveloper and then Deploy that application through jdeveloper in the weblogic application server and then run it from jdeveloper and see if its working.

  • How to run zonecfg command-line to add device in postinstall script?

    I want to assign a tape drive in non-global zone in postinstall script. I can run zonecfg with a command-file, but don't know how to run zonecfg to add device in a whole command-line.
    The command-line fails to run:
    # zonecfg -z sun1 add device set match=/dev/rmt/173b
    syntax error at 'set'
    Commands:
    add <resource-type>
    (global scope)
    add <property-name> <property-value>
    (resource scope)
    cancel
    commit
    create [-F] [ -b | -t <template> ]
    delete [-F]
    end
    exit [-F]
    export [-f output-file]
    help [commands] [syntax] [usage] [<command-name>]
    info [<resource-type> [property-name=property-value]*]
    remove <resource-type> { <property-name>=<property-value> }
    (global scope)
    remove <property-name>=<property-value>
    (resource scope)
    revert [-F]
    select <resource-type> { <property-name>=<property-value> }
    set <property-name>=<property-value>
    verify
    Thanks for your help!

    Quote the parameters and embed the newlines:
    zonecfg -z sun1 'add device
    set match=/dev/rmt/0
    end'

  • How to run a command line for every folder in a share

    I'm trying to use Robocopy to merge two user home directories shares from two different servers to a new server, but the only problem is that I can't use the /purge to mirror deletes because it will delete the other servers stuff (since one server's stuff
    doesn't exist on the other one currently).
    But I'm thinking if someone I could enumerate the folder names from the users$ share on each server, and add it to both path statements in the commands below, i could add purge since then it would be running individually per user folder, rather than at the
    user level below.
    robocopy "\\CurrentServer1\users$" "F:\Users" /E /B /COPY:DATSOU /R:1 /W:1 /MT /LOG:"C:\RobocopyLogs\MirrorUsers1.txt"
    robocopy "\\CurrentServer2\users$" "F:\Users" /E /B /COPY:DATSOU /R:1 /W:1 /MT /LOG:"C:\RobocopyLogs\MirrorUsers2.txt
    What I'm hoping is that there's some scripting genius out there who could tell me how to use a batch or vbscript to save a LOT of time.  If not, I'm doing this all by hand for hundreds of users :(
    Thanks in advance for any help you can provide.

    Mike and Bill are right on with your approach however, to show you why your code is not working I removed all "Smart Quotes" in favor of the following.
    Refrain from commenting every line.  It makes the script impossible to follow.
    $hostname='hostname'
    $migrationdata='c:\migrate\IPDATA.txt'
    $ip=Select-String -Path C:\migrate\IPDATA.txt -Pattern $hostname
    $ip = $ip.Substring(35)
    $ip = $ip.Trim()
    $dns='10.10.1.10','10.10.1.11'
    $gateway='10.10.4.1'
    $netmask='255.255.252.0'
    $dnsdomain='new.domain.local'
    $msg='We will be using the following information for the new IP stack Hostname:{0}, IP address {1} Default Gateway: {2} DNS Servers: {4} DNS Suffix: {5}'
    Write-Output ($msg -f $hostname,$Ip,$Gateway,$DNS,$DNSdomain)
    $Config=Read-Host 'Please press enter if this is correct, and we will apply this configuration. or CTRL-C to exit'
    #configure the Ip stack
    $Interface = Get-WmiObject win32_networkadapterconfiguration -filter 'IPEnabled=True'
    $Interface.EnableStatic($ip, $netmask)
    $Interface.SetGateways($Gateway, 1)
    $Interface.SetDNSServerSearchOrder($dns)
    $Interface.SetDNSDomain($dnsdomain)
    $Interface.SetDynamicDNSRegistration($true)
    #Show the user the new IP configuration
    ipconfig /allcompartments /all
    $Config = Read-Host 'We have reconfigured the NIC. Does the IP configuration for the "Local Area Connection" look right? Press enter to continue to join the domain, or CTRL-C to exit'
    Use sample white space to make code readable.
    Much of this code does not make sense.  You should be using DHCP to set all workstations and most servers with the exception of Domain Controllers.
    It will be faster to do this with PowerShell since you do not know batch.  Your attempt is not even close.
    ¯\_(ツ)_/¯

  • How to hide RMAN command line args from "ps -ef" command?

    Hi there
    This is not RMAN question per say but it is related to my RMAN script. Part of this RMAN script is below:
               rman target / catalog ${RMANID}/${RMANPW}@${RMANSID} log=${TMPFILE} << EOF
    While the script is running, if I issue "ps -ef | grep rman" command (from my own user id or as 'oracle' user), I see following:
              oracle   32522 32492 36 15:32 pts/1
    00:00:01 rman target / catalog rman/rman2013@rmancat log=/tmp/oratmp32492
    Is there a way to hide the values of the variables (Id, Pwd, SID) from the "ps -ef" command?
    If not, any other an alternates?
    Best regards

    How to Hide RMAN Passwords when Connecting to a Target Database (Doc ID 183377.1)
    How To Hide Usernames And Passwords In RMAN Logfile (Doc ID 246192.1)

  • How to run form in the background from command line

    please can anybody tell me to
    how to run form in the background from command line
    vishal

    Ummm....Oracle Forms is a foreground runtime kind of thing. What you want is a database procedure (or an OS utility - it depends on what sort of processing you want to do in the background).
    Cheers, APC

  • How to execute unix command line from cocoa?

    how to execute unix command line from cocoa?
    for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
    thank you.
    Power G5 Quad Mac OS X (10.4.3)

    The following article may also help:
    http://cocoadevcentral.com/articles/000025.php
    Mihalis.
    Dual G5 @ 2GHz   Mac OS X (10.4.6)  

  • Clear screen in "Run SQL Command Line" causes the utility to dump in Window

    Just for your notice... I have not checked if i can reproduce this on Linux platform or on second node running Windows XP Pro.
    But if I use "Run SQL Command Line" utility and do
    clear screen
    The utility dumps, (not the database though only the utlility)
    Maybe some other people could confirm if this findings is a bug or not and if it is a port specific issue with Windows XP only.
    Kindly Rgds
    /Ulf, Kentor IT Sweden

    Tracking info is in
    Re: SQL*Plus generated Program Error
    -- cj

  • How to pass a command line argument to the sequence?

    Hi,
    My GUI is written in VB.NET. I can read the command line argument in the GUI, using: Me.AxApplicationMgr.CommandLineArguments(). But I don't know how to pass it on to my sequence file which the GUI invokes. How do I read the command line argument from the sequence file?
    My purpose, is to have the same basic sequence execute different subsequences depending on starting conditions...
    I am using TestStand 3.0 with a VB.NET GUI, on Windows XP.
    I'd appreciate any help on the subject.
    Alan

    Hi Alan,
    One obvious way would be to add parameter(s) to the MainSequence and then modify the process model sequence file to use the new parameter(s) in the step "MainSequence Callback"  in either Single Pass or Test UUTs but I wouldn't recommend this approach.
    The sequence file to be run via the entry point can be found at "RunState.ProcessModelClient" and the lookup string to the MainSequence would be "RunState.ProcessModelClient.Data.Seq["MainSequence"] or .Seq[0] .
    Therefore you could quite easy use the SetVal method to setup a Local variable in the MainSequence of your Sequence File to receive the command line string.
    Also you could do this without altering the Process Model Sequence File by using the Callback Sequence ProcessSetup in your Sequence File.
    As an example.
    You have a string in your Locals of MainSequence called CmdLineStr.
    If you add the Callback Sequence ProcessSetup to your SequenceFile, then add an ActiveX Automation Adapter step which is setup for a PropertyObject and the reference is RunState.Caller.RunState.ProcessModel.Data.Seq[0].Locals.CmdLineStr.
    There is an extra RunState.Caller to the lookup string, that's because I am doing the work in a SubSequence of Entry Point Sequence.
    The method to use is SetValString and the parameters of the PropertyObject will be
    lookupString = ""
    options = 0 or 1
    newValue = where evey you have stored you command line string.
    Now when you run your sequence file you will find that the Locals.CmdLineStr will contain your parameter string.
    Hope this is of help to you.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Command line windows

    Hi,
    I am using procedures from for example: ctx_ddl, ctx_doc packages (by my program in Java - swing, jdbc). I have problem with command line windows in Windows XP, because they appear when I execute some procedures. What should I do to hide these windows?
    Regards,
    Paul Krolak

    I just fired up DOS edit and saw the blue screen after years and years... it does have one advantage over (plain unadorned) Notepad though -- indents are carried over to the next line.
    @TP -- I didn't find any sluggishness, and my machine isn't spectacularly fast (P4 2.8 GHz HT with 512+256 mismatched 400 MHz RAM running @ 333 MHz / WinXP SP2).
    db

  • Running a command line in Java

    Dear all,
    I have a question, I need to run a command line in a Java program. The commands line is the next:
    cas.exe -i file1
    I have been seeing in internet and I have tried:
    Process ls_proc = Runtime.getRuntime().exec("cmd /c start D:\\cas>cas.exe -i file1");
    it start the window where the cas folder is... but it dont run the commands line : cass.exe -i file1 :(
    Somebody can help me, please??
    Andrea

    try running it like this.
    Process ls_proc = Runtime.getRuntime().exec("cmd /c start D:\\cas>cas.exe -i file1" +"\n");
    if that does not work put this underneath the original.
    ls_proc.newLine();
    or look into the ProcessBuilder class in java.lang.

  • How to run an external .exe file from an indesign pluging

    Hi,
          Suppose if I have written an separate application in C++ (.exe file) & need to run it from an indesign pluging(as if a service in windows). have you provided that facilities in your SDK? if it's please let me know how to run an external .exe file from a indesign pluging.
    Thanks,

    I'm actully writing data in PMString to a external txt file.
    another question..
    if i want to execute an action when the ok button is cliked how can i do it?
    whe i add a button(widget) i know how to handle it. please see my code.
    // Call the base class Update function so that default behavior will still occur (OK and Cancel buttons, etc.).
    CDialogObserver::Update(theChange, theSubject, protocol, changedBy);
    do
    InterfacePtr<IControlView> controlView(theSubject, UseDefaultIID());
    ASSERT(controlView);
    if(!controlView) {
    break;
    // Get the button ID from the view.
    WidgetID theSelectedWidget = controlView->GetWidgetID();
    if (theChange == kTrueStateMessage)
    //if (theSelectedWidget == kEXTCODGoButtonWidgetID
    switch(theSelectedWidget.Get())
             case kEXTCODGoButtonWidgetID:
      this->ViewOutput();
      break;
             case kEXTCODFindButtonWidgetID:
      this->SaveLog();
      break;
    // TODO: process this
    } while (kFalse);
    I do two actions "SaveLog" & "ViewOutput()" using two buttons. But i dont know how to execute an action when the ok button is clicked...

Maybe you are looking for

  • Hr forms regarding windows

    Hi,      i am uesing hr forms for payslip. i am new to hr forms. while getting payslip, some windows r coming normal box like table( ____________  ). but some r coming in  this formate  ( - - - - - - - - - - - ).. i want same formate.. any changes ne

  • Open Acrobat pdf file with Pages

    Hi, I've read a lot of information about using pdf files with the ipad. I purchased goodreader but I'm not happy with the way text is rendered, it is blurry. When I open the same file with Safari, it looks perfect. Sent an email and I'm waiting for a

  • Version of agents that can be deployed for grid control 10.1.0.2 on Win2k

    We have the 10.1.0.2 grid control installed on a AIX 5.2 server. We would like to manage targets residing on windows 2000 platforms with this grid control installation. I would like to understand which version of agent should we be installing on the

  • Is there a way to download the files form you iCloud backup?  Not restore but actually download the files.

    Is there a way to retrieve your backup files from iCloud?  Wehn you backup locally, you can get to the actual backup files.  Is there a way to retrieve these from iCloud?  I want to actually examine the individual files.

  • IPod Shuffle won't Power on

    My son recieved an iPod shuffle from Santa for Christmas this year. When I put it on the docking station it will synch up and then turn green immediately. When it is removed from the charger it will not power on. I have tried everything on this site