Run exe file with java script in Apex

Hello All,
I have a exe file which I need to perform in Apex. I created a function by java script as fallow:
function RunEXE()
var oShell = new ActiveXObject("WScript.Shell");
var prog = "C:\WINDOWS\test.exe";
oShell.Run('"'+prog+'"',1);
Also, I created a button to run this function by redirect to URL as fallow:
javascript:RunEXE();
but it does not provide me any answer. Could any one help me on that please!!!!
Thanks,
Atousa

No, they're it's no easy solution in java. However, it's not impossible to decompile an exe file, do there it's no real difference.
Question is, who goes to the pain of compiling lots of jar files to get to your source code?
Timo

Similar Messages

  • How to run .exe files with Virtual PC for Mac

    Hey Guys, I'm new around here and with mac technology as well. Anyway, I have an iMac OS X 10.5.1 Leopard and I've recently purchased the Virtual PC for Mac 7.0.2 software. So I'd like to know how to use this program properly, because I need to run some executable files in my computer. It is confusing for me because I don't know how to get started, and I only get to the part when it says "OS not found, Install an OS on this hard drive".
    Honestly I've no idea of what an OS is or where do I get that. So I'd really appreciate if one of you guys could tell me, step by step, what to do to use Virtual PC properly, and finally learn how to run .exe files on mac.
    Thanks in advance!
    Have a nice day!

    Always nice to see new faces
    Honestly I've no idea of what an OS is or where do I get that.
    This brings up the second part of your problem. The first part is setting up either a proper Virtual Machine program like Parallels or VMfusion, or setting up a Boot Camp partition on your drive.
    http://www.parallels.com/
    http://www.vmware.com/products/fusion/
    OS stands for Operating System. You are running Leopard 10.5.7 as an operating system on your Mac (MacOS X).
    The second part of your problem - You will need a copy of Windows XP or Vista if you want to run Windows on your Mac.
    There is at least one other solution for running Windows programs on a Mac. It's called "CrossOver" by a company named 'Codeweavers'. It's based on a project for "Wine" to be able to run PC programs on a Mac or Linux, without having to buy or install Windows. It works with a narrow subset of Windows programs so you would want to make sure the program you want to run is compatible with CrossOver before you buy it.
    http://www.codeweavers.com/products/cxmac/
    In addition to all the above information, you need to upgrade your Mac to the latest 10.5.7 from 10.5.1. "Software Update" is located under the black Apple icon in the Menu Bar at the top left corner of your monitor. After you are updated you will want to update your Profile here so that it shows the proper OS version.
    With your level of experience with MacOS X and the Windows OS's you should probably get some help from a local Apple store. They have an appointment system and do offer many types of help and training, and they can offer assistance with choosing the proper programs for you to purchase for your machine.
    You are also welcome to continue to ask questions here, of course. You will want to ask your questions with different issues that come up in different threads so that the answers stay focused on the title of the thread.
    Message was edited by: dechamp to try to be more accurate with a fairly complicated issue...

  • Can we run EXE file/ Another Java Program from Java Application? How?

    Can we run EXE file and another java program from java application?
    Thanks in advance

    Example running adobe acrobat
    String command = "C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe /t "+selectedDocument+" \\\\CONTROL\\HP LaserJet 4L";
    Runtime rn = Runtime.getRuntime();
    Process process = rn.exec(command);
    process.waitFor();rykk

  • How to run .exe files with DAQ on a target PC?

    Hi,
    I want to run LabVIEW executable files on a target PC, where there is no LabVIEW installed. These files are used to do measurement using DAQ devices.
    In order to run these .exe file, I guess that I should install both LabVIEW Runtime Engine and NI-DAQmx on the target PC. Is it right?
    I'm wondering if it is mantatory to install NI-DAQmx on the target PC. I tried running .exe files without NI-DAQmx installed, but there was an error: nilvaiu.dll couldn't be found. Shouldn't this file be included automatically when building the executable files?
    Thanks,
    Qifu

    No, none of the hardware drivers are included in the LabVIEW exe that you build. You have to install DAQmx. With LabVIEW 8.x, you can include the DAQmx driver with the installer that you create. You also have the option to install different versions of DAQmx. These different versions are smaller than the full DAQmx install (i.e. you may choose to install documentation, MAX. etc.). When you create the installer, you also inclue the LabVIEW run-time and you should also choose to install the hardware configureation that is in MAX.

  • Running exe files from java applications

    Hello All,
    Is it possible to run executable files from java applications?
    I need to run an exe file on the client from the server machine, the exe could reside on either the server or any other machine on the LAN. Is it possible to specify the path of where the exe resides, and run it on a client machine?

    HI,
    I tried to launch a MS Word application using runtime.exec but it gives me some problem
    The foll. code to launch a txt file using notepad works.
    Runtime rt = Runtime.getRuntime();
    String[] callAndArgs = {"notepad.exe","C:\\coo7\\wizard.txt"};
    Process child = rt.exec(callAndArgs);
    However, oif I try to launch a MS Word application, it asks for the entire path of WINWORD.exe, (unlike just specifying notepad.exe as the first argument in String[] callAndArgs) and this can vary from one machine to another.. how do I get around this?
    The foll. code snippet works but the complete path of where WINWORD.exe might be installed on any machine, is not fixed:-(
    Runtime rt = Runtime.getRuntime();
    String[] callAndArgs = {"C:\\Program Files\\Office\\Office10\\WINWORD.exe","C:\\coo7\\wizard.doc"};
    Process child = rt.exec(callAndArgs);
    Any idea/suggestions pls..

  • Running .EXE file from Java

    Do you know, how run an .exe file, for example Internet Explorer or other program, from Java application?
    It's very important for me.

    Too run external program and pass string arguments see class java doc
    of java.lang.Runtime method exec . You see online or download or
    rename src.jar to s.zip EXTRACT and see
    exec
    public Process exec(String[] cmdarray,
    String[] envp)
    throws IOException
    Executes the specified command and arguments in a separate process with the
    specified environment.
    This is a convenience method. An invocation of the form exec(cmdarray, envp)
    behaves in exactly the same way as the invocation exec(cmdarray, envp,
    null).
    Parameters:
    cmdarray - array containing the command to call and its arguments.
    envp - array of strings, each element of which has environment variable
    settings in the format name=value, or null if the subprocess should inherit
    the environment of the current process.
    Returns:
    A new Process object for managing the subprocess
    Throws:
    SecurityException - If a security manager exists and its checkExec method
    doesn't allow creation of the subprocess
    IOException - If an I/O error occurs
    NullPointerException - If cmdarray is null, or one of the elements of
    cmdarray is null, or one of the elements of envp is null
    IndexOutOfBoundsException - If cmdarray is an empty array (has length 0)
    See Also:
    ProcessBuilder
    getRuntime
    public static Runtime getRuntime()
    Returns the runtime object associated with the current Java application.
    Most of the methods of class Runtime are instance methods and must be
    invoked with respect to the current runtime object.
    Returns:
    the Runtime object associated with the current Java application.

  • How do you run .exe files with wine by clicking on them?

    Hi, I need help with using wine on mac osx. I used to use wine on Ubuntu and Linux Mint and it was relatively simple. But on mac osx, I used macports to dowload/install wine, and i used winecfg to create a prefix. I can not figure out for the life of me how to launch an executable by clicking on it. It opens in TextEdit instead of launching in wine. Can someone explain to me how to make a .exe file launch by clicking on it? Do i have to register the filetype with wine? Wine is not in a .app format. I can run any .exe in terminal but it is less than convenient. Thanks in advance.

    So wrap Wine in an application, and bind the .exe's to the wrapper application.
    Platypus (free download)
    <http://www.versiontracker.com/dyn/moreinfo/macosx/19870>
    Can be used to turn any Unix program or script into a double clickable application, as well as a drag and drop target application.
    It should be possible to wrap Wine with Platypus.
    As an alternative, you might try Applications -> Automator -> Run Shell Script workflow, and save that as an application. Then bind your .exe's to that workflow you created.
    NOTE: I have not played with Wine, so your mileage may vary.

  • Running exe files from java progam

    hi friends
    I just want to know how can i run a .bat or .exe file in windows from a java program...
    also i would like to know if i can check if mysql is installed in a windows computer from my java program
    Thanks
    Mustafa

    smshiraz wrote:
    thanks Jos
    now i am able to execute the .bat file.....from my java program
    Can you also please tell me how can i check from my java program how if a particular application is installed in my windows computer??The exec() call will more than likely fail if the application is not present; again, read the API documentation.
    kind regards,
    Jos

  • Reading/Parsing an EXE file with Java

    Hey guys,
    Is there a way (in Java) to parse an EXE file and get its version, description, etc? (mostly the information in the VERSION tab inside the file properties window).
    Thanks.

    I can't find a thing about that. :(
    Perhaps I'll tell you what I need that for:
    I got tired of rearranging my start menu and drag-n-droppin' every time I install a new program, so I wanted to create an application that scans a folder of my choice (i.e. c:/progra~1) and creates a folder in the start menu with shortcuts to all of the EXEs in the folder and in its subfolders, arranged by application name (some applications have more than one EXE, including uninstall or update programs) and usage (that I'll do at the end, basing on rules and lists I'll create from DOWNLOAD.COM, for instance). I've done everything but the usage types filtering (putting it into folders: "system", "media", "internet", etc).
    So my problem was, that the shortcuts' names are ugly most of the times, and I can't tell the full name of an application just from its filename. For example, Google Earth's main EXE is "googleearth.exe". A shortcut that says "Googleearth" isn't so nice to look at. also, with this kind of name you can know what it does, but what about other filenames that don't exactly say what that file does?
    I needed a way to get the -true- name of the application file, and the only way I see is through the properties, in the "Description" field under "Version".
    But alas, that's not so simple :P
    I thought about simply getting the name from the folder the EXE's in, but then there are more than one EXE per folder.
    Any other suggestions will be great.
    Thanks again, guys.

  • Problem in Running EXE file from Java

    Hello Friends,
    I am calling an EXE program from my JSP page using Runtime.exec() method. The exe file simply reads a file and writes the content into another file (like copying a file). Now if I am providing fully qualified path to both source and destination files, then it runs absolutely fine. However, if i don't mention file path (only fine name is there), it creates output file in System32 folder and the resultant file doesn't contain any data.
    I am providing the source for the EXE file.
    ==============
    Source 1 (with fully qualified path name)
    #include <stdio.h>
    #include <fstream.h>
    #include <iostream.h>
    #include <string.h>
    #include <stdlib.h>
    void write_temp_file1(char *);
    void main()
    char * myTempPath=NULL;
    myTempPath=(char *)calloc(100,sizeof(char));
    strcpy(myTempPath,"D:\\temp\\tempFile.txt");
    write_temp_file1(myTempPath);
    myTempPath=NULL;
    void write_temp_file1(char * fileName)
    // first read the file and write another file with same content
    char * line1=NULL;
    char * line2=NULL;
    char * line3=NULL;
    line1=(char *)calloc(100,sizeof(char));
    line2=(char *)calloc(100,sizeof(char));
    line3=(char *)calloc(100,sizeof(char));
    ifstream inf;
    inf.open(fileName,ios::nocreate);
    inf>>line1;
    inf>>line2;
    inf>>line3;
    inf.close();
    ofstream outf;
    strcat(fileName, "1");
    outf.open(fileName);
    outf<<line1<<endl;
    outf<<line2<<endl;
    outf<<line3<<endl;
    outf.close ();
    ================================
    Scenario 2 (with file name only)
    #include <stdio.h>
    #include <fstream.h>
    #include <iostream.h>
    #include <string.h>
    #include <stdlib.h>
    void write_temp_file1(char *);
    void main()
    char * myTempPath=NULL;
    myTempPath=(char *)calloc(100,sizeof(char));
    strcpy(myTempPath,"my_temp_from_exe.txt");
    write_temp_file1(myTempPath);
    myTempPath=NULL;
    void write_temp_file1(char * fileName)
    // first read the file and write another file with same content
    char * line1=NULL;
    char * line2=NULL;
    char * line3=NULL;
    line1=(char *)calloc(100,sizeof(char));
    line2=(char *)calloc(100,sizeof(char));
    line3=(char *)calloc(100,sizeof(char));
    ifstream inf;
    inf.open(fileName,ios::nocreate);
    inf>>line1;
    inf>>line2;
    inf>>line3;
    inf.close();
    ofstream outf;
    strcat(fileName, "1");
    outf.open(fileName);
    outf<<line1<<endl;
    outf<<line2<<endl;
    outf<<line3<<endl;
    outf.close ();
    ==========================
    Can anyone figure out what could be the problem ? I think there is a problem with Library Path or sort of something like that.
    Please help me.
    -- Niranjan

    providing source code for the EXE program doesn't tell your problem.
    You have to be more specific. What is your problem?

  • Follow up question in running *.exe files in java

    Is it possible to run a *.exe program in java by launching it? I mean I have an interface and there will be a button or link that will launch the *.exe program can u guys help me on what can I do? thank you very much for your help...

    You could look up the various exec() methods of the Runtime class.

  • Can't run .jar file with JavaSE

    Hello.
    I'm trying to run a .jar file with JavaSE Binary, just like I did with Windows. I Ctrl+Rclick and pick "Open with..." and there is no such option. I've been searching the whole day for a solution, I kept getting "Open Java Preferences... put on top of the list" and things like that. There is no "Java Preferences" in the Utilities folder, and nothing related to my problem in "Java Control Panel" in System Preferences. Yes, I have Java 7. I just need to run this file with Java. How?
    Thanks in advance.

    Max. allowed size of .jar file is 1MB.

  • Require script or a method to Run .exe files on target computers using task scheduler or any other Windows server intigrated tool

    Hi All,
    We are outsourcing services to our clients. One of our clients whom we manage the whole Active directory / Exchange 2010 infrastructure have a requirement.
    We would like to run a .exe file from one server to another server / servers remotely to generate a report. The challenge is that we do not have permissions on some servers to access so we cannot login manually and run the .exe file to generate that report.
    (All are in the same domain restricted or non restricted)
    The domain Administrator (Client) Has restricted us to login to those servers due to security reasons. And is not providing us permissions or not giving the username and password to login to those servers.
    Requirement is :
    To run a .exe file with some parameters in it on the restricted servers Via powershell script or task scheduler (As the task will be created by the domain admin in the server in which we have access by entering the domain account).
    As we have to run this .exe file on around 60 servers (restricted) so an option should popup asking the name of the agent in which you want to RUN the .exe file or a source input via CSV will also be fine.
    Can anyone tell me or can this be possible ? Is there any one who has made such a script.
    Can anyone please help.
    Gautam.75801

    Hi Justin,
    Thank you for the suggestion.
    Below is the script what i Executed.
    "C:\Windows\system32\PsExec.exe" @C:\HPS\Serverrlist.txt cmd /C "server name\C$\hps\hps.EXE"
    Pause
    I tried using PSExec. But in the LAB domain as well as in the production i tried this on servers in which i have full access. When i execute this i get the output as Access is denied. Below is the screenshot of the Error.
    I have installed Psexec on both machines.
    I have full admin rights to the shared folder or network location which i have scratched in the screenshot. Not sure why i am getting this error.
    Also analysed the event logs and found a failure event once i execute this script.
    A handle to an object was requested.
    Subject:
    Security ID:
    Domain name\My username
    Account Name:
    Lg167978
    Account Domain:
    My Domain
    Logon ID:
    0x234992
    Object:
    Object Server:
    Security
    Object Type:
    File
    Object Name:
    C:\Windows\System32\eventvwr.msc
    Handle ID:
    0x0
    Process Information:
    Process ID:
    0x17e0
    Process Name:
    C:\Windows\System32\mmc.exe
    Access Request Information:
    Transaction ID:
    {00000000-0000-0000-0000-000000000000}
    Accesses:
    READ_CONTROL
    SYNCHRONIZE
    WriteData (or AddFile)
    AppendData (or AddSubdirectory or CreatePipeInstance)
    WriteEA
    ReadAttributes
    WriteAttributes
    Access Reasons:
    READ_CONTROL: Granted by
    D:(A;;0x1200a9;;;BA)
    SYNCHRONIZE:
    Granted by D:(A;;0x1200a9;;;BA)
    WriteData (or AddFile):
    Not granted
    AppendData (or AddSubdirectory or CreatePipeInstance):
    Not granted
    WriteEA:
    Not granted
    ReadAttributes:
    Granted by ACE on parent folder D:(A;;0x1301bf;;;BA)
    WriteAttributes:
    Not granted
    Access Mask:
    0x120196
    Privileges Used for Access Check:
    Restricted SID Count:
    0
    Can you help in solving this.
    Gautam.75801

  • How To Run An External .exe File With Command Line Arguments

    Hiya, could anyone tell me how I can run an external .exe file with command line arguments in Java, and if possible catch any printouts the external .exe file prints to the command line.
    Thanks.

    Using the Runtime.exec() command. And read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Error while running executable file through java in WinNT

    I would like to run an executable file with Java.
    - If I try with notepad or paint, i.e. Windows Applications,
      I have no problem.
    - I also can run Non-Windows-Own Applications, except one.
      I get an error message, if I want to run this program through Java.
    I have tried following commands to run an executable file.
    Runtime.getRuntime().exec("cmd.exe /c "+command);
    Runtime.getRuntime().exec("cmd.exe /c start "+command);
    Runtime.getRuntime().exec("cmd.exe /c start /wait "+command);
    Runtime.getRuntime().exec("cmd.exe /k start "+command);
    command : the path to the executable file
    I can run the application directly, if I click the icon on desktop,
    but not through Java.
    here is the error message I get
    screenshot : http://www.aykut.de/error_message.jpg
    Text : "Security Check failure"
            The Logon System has been tampered with.
            The Administrator will need to re-install.
    my Idea :
    The application is "old".
    I think it was written for Win 3.1.
    Therefore I don't know if there is any other
    possibilty to run a "DOS Exe File" through Java.

    I have just figured out how it works,
    if somebody else here in forum have this problem,
    here is the solution :
    String path = "F:\...\...\Application.exe";
    String envDir = path.substring(0, path.lastIndexOf("\\"));
    String[] command = {"cmd.exe", "/c", "start", "/wait", "/D"+envDir, path};
    Process process = Runtime.getRuntime().exec(command);
    "start /Dpath" => path: environment directory F:\...\...\
    "start /wait" => wait until Application.exe terminates
    if you use Win95 or Win98 use command.com instead of cmd.exe
    Aykut

Maybe you are looking for