How does one run a *.exe with a Java program?

Hi,
I'm looking for a way to run an executable (*.exe) or batch file (*.bat) from within a Java program.
Any suggestions, leads, or examples appreciated.
Thanks!

Runtime.getRuntime.exec("pathTo/yourapp.exe");
For any type of interpreted scripts, the interpreter should be added:
Runtime.getRuntime().exec({ "command.com", "mybat.bat"});
or
Runtime.getRuntime().exec({"/bin/sh", "configure.sh"});

Similar Messages

  • How does one use punch in with v 5.5?

    Hello,  just downloaded the trial in hopes the punch in functions were straightened out (my terminology)
    vs. version 3.
    So far I haven't found a way to use this (non) feature.  I can punch in but then what does one do to
    select and merge the best take?
    Once I click on the main clip in the track the punched clip goes to the background (i guess)
    Also, in previous versions I would record multiple takes and only the last (top) version would play.
    In 5.5 they all play - whether they are visible or not.
    I've searched through help and the forum for information about this and haven't found anything.
    I know I can't find things in the refrigerator either but that's beside the point.
    From what I gather it will be a while until there is an update to this version so unless someone
    can tell me how punch in and take selection is supposed to work I won't be able to upgrade.
    Assistance in this matter will be appreciated.
    Thanks.

    Durin,
    What do you mean:
    "The options to only play the topmost clip or to select which clip is played is a separate item, but also shuffling up the list."
    I also only want (like Floyd) to hear the "on top" sound from "punching in" as in V3. The marketing material for V5.5 mentions :
    Quick punch
    Quickly fix recording errors  by punching in corrections on-the-fly as you rerecord: Toggle the record  button to punch in your new take only where you want it to replace the  old one. Punch in and out as many times as you want.
    Currently nothing is replaced, only stacked on top. Freaky when you first hear the take.
    When you say "end up", should I wait for V6?
    Thank you for your time.
    -Ed

  • How can I run a servlet with Sun Java System Application Server PE 8?

    I've created a package with a TestServlet.class inside, used the deploytool to create a WAR and deployed this using the autodeploy folder.
    The filestructure has been generated and I find the TestServlet.class in
    [installdir]\domains\domain1\applications\j2ee-modules\testProject\WEB-INF\classes\[packagefolderstructure]\TestServlet.class.
    The context root is working fine, but I have no clue how I can run the servlet directly via the URL.
    I've tried many things like
    http://localhost:8080/testProject/TestServlet
    http://localhost:8080/testProject/servlet/TestServlet
    http://localhost:8080/testProject/servlet/[packagenamewithpoints]TestServlet
    http://localhost:8080/testProject/servlet/[packagenamewithslashes]TestServlet
    etc etc
    Can somebody tell me please how to write URLs to deployed servlets? Or send me an example url and xml descriptor files?
    Thanks a lot in advance!

    in web.xml use servlet mapping
    <servlet-mapping>
        <servlet-name>TestServlet</servlet-name>
        <url-pattern>/doit</url-pattern>
    </servlet-mapping>then use http://localhost:8080/testProject/doit

  • Running a .jar with a java program on unix

    I am trying to run a jar file with this java code but when i run it, it comes up with built successfully but the file doesn't run.
    ps- I use a unix os
    public class Main {
    public static void main(String args[]) throws IOException, InterruptedException {
    // first method i tried:
    Runtime.getRuntime().exec( new String[] {"/bin/sh", "-c",
    "/Users/cb/NetBeansProjects/MultiCalc/dist/MultiCalc.jar output.out ascii workload2.trace 0"});
    //second method i tried:
    ProcessBuilder pb = new ProcessBuilder( new String[] {"/bin/sh", "-c",
    "/Users/cb/NetBeansProjects/MultiCalc/dist/MultiCalc.jar"});
    pb.redirectErrorStream( true );
    pb.start();
    thanks a lot in advance!

    javalavaguava-- wrote:
    I am trying to run a jar file with this java code but when i run it, it comes up with built successfully but the file doesn't run.
    ps- I use a unix os
    public class Main {
    public static void main(String args[]) throws IOException, InterruptedException {
    // first method i tried:
    Runtime.getRuntime().exec( new String[] {"/bin/sh", "-c",
    "/Users/cb/NetBeansProjects/MultiCalc/dist/MultiCalc.jar output.out ascii workload2.trace 0"});
    //second method i tried:
    ProcessBuilder pb = new ProcessBuilder( new String[] {"/bin/sh", "-c",
    "/Users/cb/NetBeansProjects/MultiCalc/dist/MultiCalc.jar"});
    pb.redirectErrorStream( true );
    pb.start();
    thanks a lot in advance!I don't see any mention of 'java' when trying to execute the jar file. You have to specify which application should process a jar file - it doesn't magically know to use java.
    P.S. You should read the 4 sections of [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html] and implement ALL the recommendations.

  • How Can One use XML data into our Java Program

    I have an Java Program and an XML file contaning data. I want to parse the xml data and use into my Java Program. How can I do so.

    Check out the org.xml.sax.XMLReader class.

  • How does one get officeclicktorun.exe to stop running?

    Since installing Outlook 2013 I noticed that officeclicktorun.exe has been consuming the most CPU of any running app.  It takes focus of the machine when I'm in the middle of working on another app which is very annoying.
    I understand that it's installed on any machine with an Office 2013 product and automatically set to run.  I can't understand why a simply update program would consume so much CPU.  Is this a known issue?
    I found that there is a scheduled task that was set to run automatically. I turned that off and now the program won't run until I run Outlook.  But once I run that, the program takes off and becomes a resource hog. 
    I went to Office -> Office Account and disabled all updates.  The program still runs like crazy.  I tried disabling the service but then Outlook won't start.  How can I use outlook without an additional app that appears to be a resource
    hog?
    I got in the habit of using Outlook and then killing that .exe.  That doesn't work.  The .exe keeps coming back for no known reason.  I can disable the service to get it to stop running again but then I have to re-enable the service if I want
    to run Outlook again.  This is crazy!
    I can't believe that a simple method of stopping all automated upgrade activity isn't being provided by Microsoft.

    Hi,
    Officeclicktorun.exe runs as a service named 'Microsoft Office ClickToRun Service' (ClickToRunSvc). It helps manage resource coordination, background streaming, and system integration of Microsoft Office products.
    As far as I know, this service is required to run during the use of any Microsoft Office program, so you cannot just stop it permanently.
    It shouldn't consume "that" much CPU. Is your Outlook update to date? Try to update it to the latest version and then verify result. Or you might need to
    repair your Office 2013 and see if it's due to an improper installation.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How do I know if I have a wifi problem with my new iPad 3 (it seems very slow) and how does one address the problem with apple if there is one?

    I just read about the possible issue that some folks are having with their new iPad wifi (my seemed to be running very slowly but I thought that perhaps it was just me overreacting).  How do I know if I have a definite problem, and what is my recourse?  Do I need to take it to an Apple store for testing?  I have apple care which I assume addresses stuff like this.  Thoughts?  Thx so much.

    Your iPad is covered by the normal warranty for one year. If you have AppleCare that extends the coverage. If you feel there is a problem with your wifi reception visit an Apple store with your iPad for a consultation. Be sure to make an appointment before you go.

  • Subject: How does one implement variable represents with Select Option?

    All threads I read on SDN show examples with u2018EQu2019 or u2018BTu2019, Are there other values arrowed such as u2018CPu2019
    According to help.sap.com, other values should be allowed, but as soon as I use them, e.g., CP (contain pattern), one gets java exception when running query?
    http://help.sap.com/saphelp_nw70/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm
    Thanks.

    I found 'CP' does work. Vriable must represent Selction Option. If variable represnets single value or multiple single value then CP returns exceptiom.

  • How does one create a user with a null password in iManager?

    I'm setting up LDAP authentication and need to create a user with a null password.
    If you do not put a password in the password field when creating the user in iManager, a message pops up stating, No password has been defined for this user.
    You are given a choice of:
    Allow user to log in without a password
    - or -
    Do not allow user to log in without a password
    If you choose Do not allow user to log in without a password, there are no complaints.
    When I look at the properties of the newly-created user, however, I note that the "Require a password" checkbox is not filled in.
    That would imply that the answer to the question posed during the user's creation is moot; either answer produces a user that can log in without a password.
    I can then assign the Common Proxy password policy to the user, which does not dictate a minimum length for a password.
    From that point forward, any attempts to leave the password field blank in iManager results in another pop-up message stating:
    "Failure to enter a password will allow the user to login without a password."
    That implies that no password exists for the user, as opposed to a null password.
    Is that correct or are the public and private key for the user object still generated?

    If you do not specify a password, which is what happens when you select
    the 'Do not allow user to log in without a password' option initially, the
    user cannot login. A user with no password (meaning no password exists at
    all, similar to a 'null' in programming) cannot login with a password
    because, of course, they do not have a password.
    If you specify a zero-length string as the password you are effectively
    (and usually) creating a proxy user, for example to be used for the LDAP
    service in eDirectory, and this user can login typing in a password (since
    typing would imply one or more characters) but nevertheless there IS a
    password, but it happens that it is zero-length, so typing nothing for the
    password IS submitting the correct password. This is the option carried
    out by eDirectory when you choose, 'Allow user to log in without a
    password' (the prompt is a little misleading with its "without a password"
    phrase).
    Once you assign a UP policy you are telling the system that there SHOULD
    be a password on the user (and with common proxy there definitely should
    be, probably a strong one at that) so the only option now is whether or
    not the password is zero-length or longer. Obviously longer is the
    correct option for security reasons.
    Good luck.
    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  • How does one create a form with prefilled editable text in Acrobat Pro, such as for fliers or business cards that can be edited and saved by the end user in Reader?

    Working on a Mac. Have seen examples so know it's possible.

    When I created a new template like you told me, I wasn't given the option to rename the fields. See screenshot below. I'm just given the option to add a new template. Changing it refers to changing the template to a different page.
    If you can show me how to have the fields renamed automatically or use the rename parameter, I think that should fix it.
    Under Tools>JavaScript>Document JavaScripts, I've added a Script named "PackagingArtwork".
    // Here is the code
    function PackagingArtwork()
    {this.createTemplate({cName: "PackagingArtwork", nPage: 5});
    // Here the code that spawns the template
    var PackagingArtworkArray = this.templates;
              var PackagingArtwork = PackagingArtworkArray[0];
              PackagingArtwork.spawn(this.numPages, false, false);
    This is what the JS debugger said.
    Acrobat EScript Built-in Functions Version 10.0
    Acrobat SOAP 10.0
    var t1 = createTemplate("t1", 0);
    var oXO = t1.spawn({nPage: numPages, bOverlay: false});
    while (numPages < 50) {
        t1.spawn({nPage: numPages,  bOverlay: false, oXObject: oXO});
    undefined
    [object CosObj=<<Stream>>]
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1

  • How does one pan an image with Preview??

    There doesn't seem to be a hand tool in order to pan a zoomed image.  Help would be appreciated.

    On my magic mouse I can just swipe (up, down, left or right) with my finger. The arrow keys seem to work for me too.
    What kind of pointing device do you have (trackpad, magic mouse, apple mouse, etc.)?
    Edit: If you have a mouse with a standard scroll wheel try holding the shift key to scroll horizontally.

  • How does one run a shell script at system startup?

    Hi,
    I am trying to unmount my Boot Camp hard drive on my MacBook Pro. Now what I could do is create an automator action, save it as an application and then put it into my user´s login items. I am wondering though - shouldnt it be possible to run a simple shell script command like +diskutil unmount /Volumes/"Boot Camp"+ sometime during the startup process?
    Or to put it another way - is there an easy way to do this or do i have to create an manage a daemon through launchd ?
    Your help is very much appreciated.

    sorry I forgot to mention that there is a bug in Lingon which creates a plist incorrectly if you enter your script explicitly on line 2. At least I haven't been able to make it work. A workaround I always use it the following.
    Save your script as a *plain text* file from your favorite text editor. change the extension to .sh and make the file unix executable. Now, when you ccreate a launch daemon using Lingon, enter the path to that file instead of the script itself.
    This always works for me.
    Good luck!

  • How do i run an .exe from inside java?

    Thanks for any help
    maggie

    It varies for different OSs'
    Runtime.getRuntime().exec("start <path to something.exe>"); // win98

  • How to make Exe file of java program

    how we can make the exe file of java programs. that can run independently of particuler JVM. like in VB we can create exe files.
    - early thanks

    Check this out:
    http://search.java.sun.com/search/java/index.jsp?qp=%2B
    orum%3A31&nh=10&qt=create+exe+file+program&col=javaforu
    s

  • How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8)

    How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8) since November until now.  Mail will no longer download on the MacBook Pro and keeps asking for my password.

    Mail should still be usable with your machine - but you'll need to update the settings to conform to the requirements of your system. Check with your ISP (like ATT, etc.) for the settings that will work with your Mail. Once you've updated this, you should be able to email like before.
    For example, my ISP required that I go to Mail Preferences/Accounts and make sure the details conform to your email settings.
    I have no idea of what your ISP is or what the settings might be, but this is likely the source of the problem.

Maybe you are looking for

  • 790FX-GD70 - have to boot several times - CMOS Memory Wrong - 2E?

    Well I just recently bought this mobo and have some problems already. My config ============ - Phenom X4 955 - 4GB GoodRam 1333MHz - Sapphire Radeon HD4890 Vapor-X - Intel SSD 80GB Gen2 - Samsung H3EG 500GB - PSU BeQuiet! PurePower L7 530W All power

  • HD editing with a Macbook Pro

    Hi everyone, This is my first post, so please be gentle. : ) I don't have a mac yet, but after years of unreliable PC's (not to mention Premiere crashing all the time) I am looking at buying one for editing. I can't realistically afford a macpro towe

  • What does this error message mean any how can I fix it?

    I am running windows XP When I go to the command prompt, and type javac StdOut.java (StdOut.java is a java file that contains the source code for the StdOut method), I get this response: 'javac' is not recognized as an internal or extrenal command, o

  • Cross company code transaction error in F-48

    Dear all I have a problem in cross company code posting. I have done all the settings like company codes are assigned to company(OX16) and i maintained gl accounts in OBYA also. When i am trying to post cross company code posting i am getting the err

  • Javascript error - recovery?

    I have just spent rather a long time writing a document on my Blackberry curve and the device appears to have lost it having displayed 'javascript error'.  Is there a method I can use to retrieve the document?  Does anyone have any idea what might ha