Invoke command in new dos window

is there any way that i can invoke a command in a new dos window from java application?
such as
runtime.exec("dir");
it will open another dos window, and run dir in it.
thanks

it will open another dos window, and run dir in it.This works for me (win 2000):
Runtime.getRuntime().exec("cmd /c start dir");

Similar Messages

  • Call x.exe and write command in opened DOS window

    Hi,
    I am using Labview 10 and Window 7. Just wondering how to use labview to
    1. run x.exe under opened DOS window?
    2. write command in opened DOS window?
    Any commends welcome,
    Thanks,
    Ott

    Please take a look here
    Alejandro | Academic Program Engineer | National Instruments

  • Runtime.exec open new DOS Window

    Hi,
    I want to execute a program (a.exe) having as work directory (C:\geo\B\)
    I create a batch file for changing into the directory and executing the command in the way:
    cd C:\geo\B
    start a.exeThis batch file (art.bat), I execute it in the following way within the run method of a Thread:
      public void run() {
          Process proc = Runtime.getRuntime().exec("cmd /K start " + art.bat);
          proc.waitFor();
          proc.destroy();
       }The fact is that works fine, but with this execution it opens a DOS window and i would prefer to avoid the appearance of new windows.... any help??
    Thanks All,
    Al

    cmd always opens a dos window - use another console interpreter instead or just call the programm directly.
    i.e.
    Runetime.exec("c:\\myprogram.exe");

  • Command Prompt in DOS Window

    Is it possibe, when running a Swing Application to
    get the command prompt back in order to do other
    things in the background while the application is
    running. (I wouldn't need to close my application in
    order to get the prompt back!)
    If so how would I do that?
    Thank you very much in advance for any help.

    very simple....
    create a batch file and then from dos window say
    start YourFile.bat
    you get your command prompt back...but that will open another prompt window for the applicationm

  • Executing command in new powershell window

    Hello guys, I'd like explore directions with gci, but the thing is that istead of using -recurse I'd like to open every single direction in new powershell window. I've made something like this:
    function Get-ScriptDirectory
        $Invocation = (Get-Variable MyInvocation -Scope 1).Value
        Split-Path $Invocation.MyCommand.Path
    $path = Get-ScriptDirectory
    $paths = Get-ChildItem $path -Recurse | ?{ $_.PSIsContainer }
    foreach ($element in $paths) 
        start-process powershell
        $new= $path, $element -join "\"  
        gci $new
    But I don't know to make Powershelle execute command in new window. Start-process powershell only opens new window, but it doesn't import bolded commands. Can I get any suggestions?

    Hi Shadston,
    To add cmdlet in "-command", please refer to the script below:
    Get-ChildItem (Split-Path $MyInvocation.MyCommand.Path) -Recurse -Directory |ForEach-Object{
    start-process -FilePath powershell -ArgumentList @('-NoExit',"& {GCI '$($_.FullName)'; Write-Host 'Hello' }")
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How would I print information to a DOS window?

    Ok so I can get the DOS window running by using this code:
          try{
                       Runtime rt = Runtime.getRuntime();
                       Process child = rt.exec("cmd.exe /c start cmd.exe");
                       child.waitFor();
                   }catch(IOException io){}
                   catch(InterruptedException e) {}but I want to print the information from this code:
    StringBuffer objectString = new StringBuffer("");
    ////some code here//////
    objectString = new StringBuffer(("Customer:\t\t" + customerName + "\n"
                               + "Departure Date:\t" + departureDate + "\n"
                               + "Return Date:\t" + _returnDate));
    ////some code here/////
    objectString.append("\nAirline:\t\t" + airlineBG.getSelection().getActionCommand());
    objectString.append("\nDestination:\t" + destinationBG.getSelection().getActionCommand());
    /////more code. yay//////
    objectString.append("\nPrice:\t\t" + price);
    objectString.append("\nTicket Bought. Have a safe flight!");
    System.out.print(objectString.toString());//print string bufferso how would I print objectString to the DOS window?
    Note: opening the DOS window is in the constructor for the JFrame I am using while printing the StringBuffer is in the actionPerformed implementation.

    masijade. wrote:
    deadmanwalkin wrote:
    no, the program im supposed to be making asks to print ticket information to a DOS window.
    I might have interpreted it wrong and it could be just start from a DOS window using the java File commandWell, study your assignment text. If it does not explicitly state that you must programmatically open a new "DOS window", then simply print your output using System.out.println().Unless he's running Windows 95 still he can't even open a DOS window as there's no more DOS ;)

  • A weird question on opening a new finder window

    this is not a big deal, but it really bugs me. when you have a finder window open and do apple-N to get a new one, it puts the new one right on top of the one already open. this is totally stupid. 99% of the time when i open a new window it's because i want to drag a file from one location to another, in which case i have to first move the new window. is there some way you can have it put new windows someplace else other than right on top of the current one?
    and please, please, please dear apple, give us tabs in finder windows like in safari. i keep expecting it to happen in each new system upgrade, and it keeps never happening.

    ...when you have a finder window open and do apple-N to get a new one, it puts the new one right on top of the one already open... is there some way you can have it put new windows someplace else other than right on top of the current one?
    In addition to the excellent suggestions regarding the Sidebar offered earlier, you might consider creating an AppleScript and adding it to your Finder window's toolbar. Once added to the toolbar, the script would serve as a button, which, when clicked on, would open a fully viewable new Finder window positioned above and slightly to the left of the existing Finder window. The existing Finder window would be repositioned if necessary and set to a size matching the dimensions of the new window.
    The example scripts below were created with the assumption that your Home folder's Finder window opens when you press ⌘N. These scripts can be modified so that another window is opened instead by replacing the word "home" where it appears in the script with "desktop" or "documents" or "applications" etc. To open the "Computer" window use the command *make new Finder window* exclusively. Paths to non system-level folders, or user-created folders, can be specified by using an *open "Macintosh HD:path:to:folder"* command.
    Copy and then paste either block of code below into your AppleScript Script Editor (Applications > AppleScript > Script Editor). From the Script Editor's File menu choose Save As > File Format: application, and leave the Options unchecked.
    To add the button to your Finder window's toolbar, simply open any Finder window and drag the saved AppleScript icon to a convenient location on the toolbar. Let go of your mouse when you see the round green "+" indicator.
    +This script might work best with a monitor set to a minimum 1024 x 768 screen resolution:+
    *tell application "Finder"*
    activate
    *make new Finder window to (path to home folder)*
    *set the bounds of window 1 to {70, 59, 955, 399}*
    *set the bounds of window 2 to {100, 403, 985, 743}*
    *activate window 2*
    *end tell*
    +This version would be more suitable for a monitor set to 800 x 600 screen resolution:+
    *tell application "Finder"*
    activate
    *make new Finder window to (path to home folder)*
    *set the bounds of window 1 to {85, 47, 715, 317}*
    *set the bounds of window 2 to {115, 320, 745, 595}*
    *activate window 2*
    *end tell*
    Good luck.

  • Is it possible to write to an open DOS windows - command line

    HI,
    I am able to open applications from LabVIEW, But except for the first command I am unable to write to the same application again and the LabVIEW will always open a new application. Is there a way to communicate with a DOS window application without re opening it each time? Is there a possibility to have a Dialogue with a DOS window?
    Thanks

    Hi,
    The command "Tasklist" will return the applications running in the system (as viewed in the task manager).  Parse the list and if the application you are trying to launch is already running do not launch else launch the application following the same procedure.
    With regards,
    JK
    (Certified LabVIEW Developer)
    Give Kudos for Good Answers, and Mark it a solution if your problem is solved.

  • Command to open a PDF generated Oracle Report in New browser window

    I know this is probably something for the Oracle Forums but I'll ask anyway because I can't find any info out there on this, without some extra work.
    I am generating a PDF file from 10g Oracle reports on Linux RHEL 5 and storing the PDF file to the server. I can send that PDF file directly to a printer with the "lpr" command and that part works fine.
    What I'm wanting to do now is "View" the PDF from within the server in a new window. We are using RHEL 5 (Linux) platform and I'm trying to see if there is a way to open the file with a "command line" command that will open it in a new browser window or new window period (opening it with Adobe Acrobat).
    Does anyone have a command that will do this? Otherwise, how has everyone else been handling this. The idea of just viewing the previously generated PDF Report file will save us overhead on our database servers because they won't have to re-run some of the same reports over and over.
    Any help and assistance is appreciated.
    Chris

    Several options:
    - If you only want to show the pdf to the client without printing, use destype=cache and use WEB.SHOW_DOCUMENT after the RUN_REPORT_OBJECT (for examples search the forms-forum, there are lots)
    -If you have to generate the pdf to a file to get it printed, you could
    +use WEBUTIL_FILETRANSFER.AS_TO_CLIENT after the printing to transfer the file to the client, then use CLIENT_HOST to view it.
    +map the appserver-directory you generate the report to as a virtual directory in the application-server then use WEB.SHOW_DOCUMENT to directly access the generated file via url.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to open new browser window on click of command button

    Hi,
    We have a requirement to open an image in new window when a command button is clicked. Is there any sample explaining how to do that?
    Thanks in Advance,
    Pradeep

    Hi,
    I have to load an applet viewer in the new browser window. I have URL to the PDF.
    I ma able to load the applet viewer in new browser window using javascript. But I have to load the new PDF if the same window in already opened.
    The issue here is , i am loosing the window handle if the parent page is refreshed. I want to store the window handle in session scope variable and use the same.
    How do i update the session scope variable using javascript?
    Thanks and Regards,
    Pradeep

  • Starting command line exec without dos window...

    I'm trying to start a console window application under my java swing application with the Runtime.exec(cmd) function.
    A dos window appear during the execution of the application. How to remove the screen echo ?
    Thanks
    SEB

    Hi ollie lord and thank you for your suggestion.
    I tried to use a *.bat file instead but the result was the same. I tried to use the word "start" in the command but nothing more.
    My .bat file is simple:
    start myprogram or myprogram
    ...where myprogram.exe is a win32 console application from Visual C++.
    Is there any option in function Main() in C++ to remove the dos console ?
    I head about the JNI tech. Is it a solution ?
    Thanks
    SEB

  • When my most front window is a safari one and I use the shortcut key "Command N", it opens a new finder window and a new safari window at the same time. Why does it happen?

    When my most front window is a safari one and I use the shortcut key "Command N", it opens a new finder window and a new safari window at the same time. Why does it happen?

    I just found the solution!
    Niel
    Re: Why is my Finder window popping up when I open my Safari window? 
    Jan 20, 2008 7:58 PM (in response to alak)
    Open the General tab of the Safari preferences and correct the home page; the default page is this one. If it has become set to a folder on an FTP server or a local drive, that request will be sent to the Finder. (28252) 
    iMac Late 2007 Core 2 Duo, Mac OS X (10.5.1)

  • DOS/Windows command in app server

    I don't know if this is the correct forum.
    I want to know if there is a t-code or report to execute a DOS/Windows command in the application server.
    thanks all in advance.

    Hello Mauro,
    you can define an external command in SM69.
    Regards
    Gregor

  • UI Mass Command opening new window

    Hi all,
    I need your help. I would like to create new UI Mass Command which will open new IE window.
    For better understanding of my problem:
    I've created UI Mass Command which take selected resources and add them to ZIP archive. The final ZIP stream I store to a static class. Then I create servlet which loads the ZIP stream from the static class and offer it to user for downloading. But I need modify the command to be able call the servlet in new window.
    Do you have any idea how to do that? Thank you in advance for any reply!
    Regards
    Zbynek

    Hi Zbynek ,
    You need to implement a class which extends AbstractCommand class and in the method getLinkAttributes() you can return the link that should be executed when user click the UICommand.
    Check this to know, how to implement UICommand:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/Implementing%20Flexible%20UI%20One-Step-Screenflow.article
    Here is getLinkAttributes implementation:
    public LinkAttributes getLinkAttributes() {
            try {
                String path = getResource().getRID().getPath();
                     String irjString = pcr.getServletRequest().getContextPath();
                   String linkRef = irjString + "/servlet/prt/portal/prtroot/YourComponent";
                return new LinkAttributes(
                    "javascript:me.window.open('"
                        + linkRef
                        + "?path="
                        + path
                        + "', 'myWin_"
                        + System.currentTimeMillis()
                        + "', 'left=250, top=250, toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=700,height=350');",
                    "_top",
                    true);
            } catch (ResourceException e) {
                log.severe(e, "Operation failed");
                return null;
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

  • Supressing Dos window on executing system command

    Hey,
    is there any way to supress the dos window when I call a system dependent .exe or bat file?
    AND
    is there any way to run a .exe file as a background process so that no window of it pops up?
    I use the Runtime.exe() to execute the system command but I'm annoyed by the dos windows it opens up.
    Any help highly appreciated.

    This is an AGE OLD Issue which Sun keep burying. By burying I mean it has been the top of their bugs/requests list many times. They just decide its closed without making any such fixes. The community is not pleased with Suns actions in this respect, blowing off their highest rated request.
    Answer:
    If you start your program with java.exe, then you wont get that window when you do runtime commands. If you start with javaw.exe, you will. They are blaiming it on M$ but most feel its just a silly Sun position and lame attempt to put somethign on M$ that is not really on M$. Sun can do it but they feel their solution is unstable. Most people have ended up making .exes to replace java.exe to get rid of that hideous console window. JBuilder has an interesting (but not my type) solution.
    If you search the top 10 bugs/ requests this one has likely resurfaced as Sun keeps erasing it, but the people keep voting it back to the top...

Maybe you are looking for

  • Launching ERP (ECC 6.0) from CLM

    Hello, We have a requirement for a phase in our CLM roll out to create a link in a master agreement to launch ERP to view the contact in ME33k.  Has anyone done something similar in CLM? or is there any standard functionality to accomplish this.  I w

  • Security Filter fails when level has only one member

    Hi. This is Essbase version 9.3. I have a forecast app\db to allow users enter\modify the forecast of the different products. The Product Dimension has the following hierarchy. All Products Planner 1 Supplier A Product_A1 Product_A2Supplier B Product

  • Problem with image path names

    We have a website created in CF4.5 and is hosted on our own server, call it www.oldsite.com  A vendor created a new website which is hosted at another location and it uses the same name and the DNS info was updated so this new site has the same name

  • I want to drag and drop a file to a JText area with its file icon

    I want to drag and drop a file to a JText area with its file icon , but the problem is I cant show the file icon. Anyone knows this. this is my code. import java.awt.*; import java.awt.image.BufferedImage; import java.awt.datatransfer.DataFlavor; imp

  • Checksum incorrect

    Hi, I have written a java program that creates a ServerSocket. This ServerSocket sends a custom object with readObject() function to any connection established. The problem appears when I listen to the network traffic ( with ethereal ). I realized th