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

Similar Messages

  • PLEASE HELP!! HOW DO I RUN A .EXE APPLICATION INSIDE A BROWSER!!

    hello everyone,
    i Run a website, named www.anarchywars.com and basicaly i made a mini game in a program called "Game-Make 6", basicaly when i save it to an .exe its very useful because all it needs to run is that .exe and you can play the game. Basicaly i want to put that game onto my website, the website is a PHP back MYSQL database, and i want this, when someone click "run" to be able to run inside the browser. It isnt a motion picture game, its just text based and has a few images.
    If i could just direct everyone attention to this site http://www.miniclip.com/games/en/
    they have that sort of things with there games, so can someone please help me out here? thank you. For a try of the game, it isnt up yet just to download to get an idea, go here. www.anarchywars.com/game.exe
    download and have a look!
    Thank you very much!
    Regards
    Jesse
    P.S Game Make 6 can be downloaded for free, by going here http://www.gamemaker.nl/

    the manifest file was used, and the jar file runs fine
    if I use the java command. I just can't get it to run
    with the jre.exe file. Any other ideas.The jre command is only for programs developed under the 1.1 platform. For programs developed with the 1.2 platform and higher we use the java command with the -jar option. And judging from the Java Tutorial lesson on Jar files, these commands are not interchaengable.
    Judging from the topic of your question, it seems to me that you think that the JRE does not contain the java command. It does if it is version 1.2 or higher.

  • 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"});

  • How to run exe file from inside java

    I wan to run an exe file from inside java code. How can I do it?
    Thanks

    Hi Oakam
    This is very simple. Just go through the given code below
    in place of FILEANDPATHNAME just give the exe's path and name
    Note :- adding ".exe " is not necessary
    public class exep
    public static void main(String args[])
    Runtime r = Runtime.getRuntime();
    Process p = null;
    try{
    p = r.exec("FILEANDPATHNAME");
    catch(Exception e)
    Give ur feedback
    Thanx
    Ottran

  • Facing problem with running exe from my java code

    Hello,
    I have to run the exe from java code for which I m using Runtime and Process classes. The exe runs in the following way on command line
    C:/ myexe -j [now press enter]
    input sentence followed by ! [now press enter]
    And after this exe gives the output.
    So is there any way to achieve this programmatically in Java?
    Thanks in advance.
    Regards,

    I m confused .. how can i pass input to the Process through InputStream? I think it will need OutputStream for that.
    Here is my code...
    import java.io.*;
    class CallToExe
    static BufferedReader br;
    public static void main(String[] args)
    File F = new File("C:/Chasen.exe");
    try
    if( F.exists())
         System.out.println("Exe exists");
         Runtime rt = Runtime.getRuntime();
         Process proc = rt.exec("C:/chasen.exe");
         br = new BufferedReader(new InputStreamReader(in));
         int a = in.read();
         System.out.println(a);
         String res = br.readLine();
         System.out.println(res);     
         while(!res.equals(null))
         System.out.println(res);     
         res = br.readLine();
    proc.waitFor();
         proc.destroy();
    catch(NullPointerException npe)
         npe.printStackTrace();
    catch (Exception IOEx)
    IOEx.printStackTrace();
    But it doesnt work as my chasen.exe needs arguments from stdin.
    The way exe works is as follows.
    on command prompt>>
    C:/chasen.exe -j [ Need to press ENTER here]
    input statement . [ Need to press ENTER here too]
    Then output is displayed on command prompt which can be taken from InputStream of the process. But I m not able to properly run this exe itself with all the arguments frm Stdin

  • I cannot uninstall Firefox, either through Control Panel Add/Remove or by running helper.exe from Program Files.

    Nothing happens when I click on REMOVE for Mozilla Firefox from the Add/Remove screen of Control Panel. I then tried to run helper.exe from the Mozilla Firefox folder in Program Files, but that wouldn't run either. Any suggestions?
    == This happened ==
    Just once or twice
    == When I tried to uninstall Firefox

    unistalled foxtab, however the window saying "want to add this pers. button to toolbar" no matter what I do I can't get it off , close firefox, remove or delete or get a new firefox download to replace it in the harddrive etc. Its locked up firefox and I have to use safari to access the web. how do I get this circular message etc. off ?

  • How to start java.exe from a java program in windows ?

    Hi,
    I did like to know, if its possible to run java.exe from a java program on windows ? The java.exe should be visible from checking the processes that are currently running using the Task Manager on windows.

    Runtime.getRuntime().exec("java Sample");

  • Request to run updater.exe from an unknown publisher starting firefox

    every time Firefox is started from initial turn on of computer (not from the computer being hibernated or in sleep mode), I receive a message to run Updater.exe from an Unknown Publisher. There is nothing to show that this is a Firefox application but, I am not receiving any threat messages either. Is there any way to find out where this Updater is coming from and if it is to be trusted?

    Do you use a Norton security suite? If so, I suggest checking with Norton's support on whether that prompt is legitimate.
    You will find numerous unofficial distributors advertising on Google for Firefox downloads. These generally are bundles of crap along with Firefox. You should check to make sure you don't have such a thing installed.
    Open the Windows '''Control Panel''', Uninstall a Program. After the list loads, click the "Installed on" column heading to group the infections, I mean, additions, by date. This can help surface undisclosed bundle items that snuck in with some software you agreed to install. Take out as much trash as possible here.
    You can supplement your regular security software with the '''scanning/cleaning tools''' listed in our support article: [[Troubleshoot Firefox issues caused by malware]]. These on-demand scanners are free and take considerable time to run. If they finish quickly and especially if they require payment, you may have a serious infection. I suggest the specialized forums listed in the article in that case.
    Does that help?

  • HT1347 How do I run two libraries from one computer?

    How do I run two libraries from one computer? One library is on the computer's hard drive, the second library is on an external hard drive. The computer that had the external hard drive crashed and I need to fix the iTunes library on it. How can I do this without corrupting the library on my internal hard drive?

    Launch iTunes with the Shift key held down and either create a new library or choose the one on the external drive. Any rented movies downloaded from another computer won't play.
    (81212)

  • Considering a Macbook pro 13".  want to use garage band - how do i run line in from my guitar.  There is not a mic/line input that I can see in specs.

    Considering buying a Macbook pro 13".  Want to use garage band - how do i run line in from my guitar.  There is not a mic/line input that I can see in specs.

    Simple. GarageBand question, GarageBand forum where all those users are jacked into their Macs and can tell you how. Also look to the right of your post to the column, "More Like This."---------------------------------------------->
    https://discussions.apple.com/community/ilife/garageband

  • Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro?  All my apps I was used in my iPad, thanks guys!!!!

    The Mac OS X and iOS versions are separate products

  • How can I run ni488216.exe without any prompts during installation?

    How can I run ni488216.exe without any prompts during installation (Silent mode)?

    Typically you can do a silent install of the NI-488.2 software by running:
    setup.exe /S LV_INSTALL path=
    Regards,
    Greg Caesar
    National Instruments
    Applications Engineer

  • Running @Script.sql from inside C#

    I'm trying to include a script file as part of a deployment. I'm able to connect to my Oracle XE database in code and run stored procedures as well as text commands. My deployment will copy a script file into an install directory for later use. When the user activates history recording, I want to run this script file.
    I can run the script manually...@"C:\Program Files\History Setup\TestScript.sql"...without issue. Works just fine.
    Currently I recieve an invalid sql command error. At the moment I'm trying:
    Command.Connection = myconnection;
    Command.CommandText = @"@""C:\Program Files\History Setup\TestScript.sql""";
    Command.CommandType = CommandType.Text;
    try
    Connection.Open();
    Command.ExecuteNonQuerry;
    catch (Exception ex)
    error handling
    If anyone has advice for running script files from inside C#, it would be appreciated.

    The other Dennis is correct. You must cleanup the text.
    This should give you a start. I have had good results using the forward slash as a delimiter.
    r,
    dennis
    byte[] ba = GetFileContent("SomeFileName");
    string All_My_Statements = Encoding.UTF8.GetString(ba);
    ExecutScript(NetConnectionString, All_My_Statements);
            public void ExecuteScript(string _connectstring, string _final_statements)
                   string[] cmd_seq = _final_statements.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < cmd_seq.Length; i++)
                    string act_cmd = cmd_seq;
    string tmp = actcmd.Replace("\r\n", "");
    act_cmd = _tmp;
    if (act_cmd.Length > 2)
    try
    int r = ExecuteTextNonQuery(_connectstring, act_cmd);
    if (r == 1) // success
    LogThis("\tSuccess:" + act_cmd);
    else
    LogThis("\tExecuted:" + act_cmd);
    catch (OracleException) { LogThis("\tException:" + act_cmd); }
    catch (System.Exception) { LogThis("\tException:" + act_cmd); }
    public static byte[] GetFileContent(string f)
    byte[] ba = null;
    try
    System.IO.FileStream fs = new FileStream(f, FileMode.Open);
    System.IO.BinaryReader br = new BinaryReader(fs);
    ba = br.ReadBytes((int)fs.Length);
    br.Close();
    fs.Close();
    catch (System.Exception) { };
    return ba;
    public static int ExecuteTextNonQuery(string connectionString, string exec)
    int rtn_int = -1;
    using (OracleConnection oraconn = new OracleConnection(connectionString))
    string execcmd = exec;
    try
    _oraconn.Open();
    using (OracleCommand cmd = new OracleCommand(_execcmd, _oraconn))
    cmd.CommandType = CommandType.Text;
    rtn_int = cmd.ExecuteNonQuery();
    catch (OracleException _oraEx)
    throw (_oraEx); // Actually rethrow
    catch (System.Exception _sysEx)
    throw (_sysEx); // Actually rethrow
    finally
    if (_oraconn.State == ConnectionState.Broken || _oraconn.State == ConnectionState.Open)
    _oraconn.Close();
    } //using _conn
    return rtn_int;

  • How can i run an applet from a webpage????

    can someone PLEASE tell me how i can run an applet from my webpage. a detailed response would be extremely appreciated.
    sam

    Here's a web page that you can use as skeleton. You should be able to start with that.
    <HTML>
    <HEAD>
    <TITLE>Title</TITLE>
    </HEAD>
    <BODY>
    <APPLET CODE="your.class" WIDTH=400 HEIGHT=300 IGNORE=""></APPLET>
    </BODY>
    </HTML>

  • How can i run unix script from my apex page

    how can i run unix script from my apex page and take the output of unix script as a hidden variable and display it on the report region of that page

    I had a requirement to run a Fortran program against some data that woudl be extracted from the database after the user set up their filtering criteria and made some additional input. SInce the program was to complex to conver to PL/SQL, we decided to try and invoke it from Apex. This is how I did it.
    1. I followed the steps in Tim Archer's excellent article "Oracle External Procedure to Run Host Commands" (http://www.timarcher.com/?q=node/9). If the link does nto work, google the article's title.
    Using this steps I created a function which accepts any OS command, including calling my own shell scripts, and runs them. I called my PL/SQL function "shell" instead of "USF_RUN_HOST_CMD " as Tim did in his example (step 9).
    2. In Apex,
    a. I created a button to run my shell command. (I named it P2_RUN_SHELL)
    b. I created a PL/SQL process whose source looks as follows:
    shell('/home/ackness/scripts/cr_xcf_file.sh > /tmp/cr_scfp_file.log');
    and which was conditioned on the the button P2_RUN_SHELL.
    It works like a charm.
    Note: since you can run your own scripts using this method, you can encapsulate a series of commands in a UNIX shell script and invoke that script from Apex. This allows you to be able to test or run you commands from the command line as well as Apex and makes it easier to develop/debug/enhance the scripts in the future.
    Ackness

Maybe you are looking for

  • Runtime errors : CONVT_CODEPAGE

    Dear ABAPers, I have used a small abap report to filter the error records from orginal source file(.txt) and made a error free records in the new file and used GUI_DOWNLOAD FM to download same as .txt file. Now am trying to use the new .txt file to u

  • HT1451 can't copy files to playlist

    I just installed the newest version of Itunes (11.1.4.62).  Now I can't add songs to playlists.  I tried creating a new playlist which works, but to add songs to it, when I try to drag and drop anything into the playlist it doesn't work.  I opened up

  • Scrolling bars in indesign (windows 8) are locked

    Help, I just donwloaded inDesign for windows 8 and the side and bottom scrolling bars don't work! I can only move through the page with the hand tool and it is horrible!

  • TS4123 how to resolve itunes store X youku conflict

    how to resolve itunes store X youku conflict i can see there is both windows and apple and also youku in LSP but ive tried to delete youku and just run itunes yet it wont access itune store i just keep on getting loading bar that wont load . any sugg

  • Reg ;  spau and spdd errors

    Dear ,          we have applied the patch in SAP 4.7. and we got the errors under 1) with modification 2) with out modification                 i observed errors under with modification , errors are                     i seen two error fuction module