Executing several .exe program in Window

I am going to write a quick program, it is to start several .exe programs ONE after ONE, each with a fixed time period, for example: 3 minutes. When time expired, this program is stopped and the next one starts....
programA.exe 3 mins
programB.exe 5 mins
movieC.avi 6 mins
Can I use Process.getRuntime().exec() to do it? Beside, is it possible to use Java to "terminate" the program when time expired?
Any suggestion, thx for any recommendation.

roamer wrote:
I am going to write a quick program, it is to start several .exe programs ONE after ONE, each with a fixed time period, for example: 3 minutes. When time expired, this program is stopped and the next one starts....
programA.exe 3 mins
programB.exe 5 mins
movieC.avi 6 mins
Can I use Process.getRuntime().exec() to do it? Yes. Runtime.exec() uses ProcessBuilder behind the scenes and you can get a little more control by directly using ProcessBuilder. You should spend some time reading 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 you should implement the recommendations.
Beside, is it possible to use Java to "terminate" the program when time expired?Yes. You can use Process#destroy().
>
Any suggestion, thx for any recommendation.

Similar Messages

  • Cannot execute sapevt.exe on a Windows platform

    Hi
    for some reason I cannot get the sapevt.exe program to raise an event in SAP when running on a Windows platform. The command line I'm using is :
    D:\usr\sap\<SID>\SYS\exe\uc\NTAMD64\sapevt.exe event=EVENT_NAME -t2 name=<SID> pf=D:\usr\sap\<SID>\SYS\profile\DEFAULT.PFL
    It doesn't write an dev.evt trace file either. Also I'm using inside a VB script.
    I can raise the event from within SAP Tcode SM62 and it runs fine in a Unix environment with slightly different parameters of course
    Anybody help please.
    I've looked at notes 802172 and others and tried all the suggestions within.
    Thanks
    Regards
    Steve

    I have the following command defined in SM69 that works on our Windows-based SAP systems:
    Operating system command = sapevt
    Parameters for operating system command = ? -p ? -t pf=$/DIR_INSTALL/\profile\default.pfl
    Additional Parameters Allowed is checked
    What not try and define that and then trigger it inside SAP itself? It might clue you in as to what the issue might be. The input parameters are the event name and then any additional parameters when triggering the event.
    Brian

  • Creating .exe program for windows

    How can I create an executable program (.exe) for windows. I tried using Excelsior-JET compiler but it doesn't increase the efficiency of program. Is there some other standard method for creating .exe
    Also if u suggest me to use JIT, do tell me some details about how to use it.

    Hey guys don't u need to develop application for windows.

  • Call several .exe program via one RFC destination

    Hi,
    We use a RFC destination (one for each connected user) to communicate between SAP R/3 (4.6c) and an AS400 application via RFC server in .NET.
    We need to call some .NET functions (for transactionnal purpose) and we wish not to mix functions refering to AS400 and .NET.
    Is it possible to use one RFC destination to call functions in at least 2 .NET program ?
    If not, is there other ways to make those communications work ?

    Hi
    It is not possible. I don't think of any other way to resolve this.
    Thanks & Regards,
    Govind.

  • Executing Windows EXE program through JNLP

    Hello,
    I am trying to execute Windows .exe and dlls through Java web start/JNLP but unable to implement successfully. I tried by creating the content (exe and dlls) as a jar file and added as native resource library in the JNLP but not sure how to call the exe program?
    Any help or sample code is much appreciated.
    Thanks,
    Edited by: b_raja on Feb 21, 2008 2:58 PM

    I am trying achieve similar thing using JNLP. So far in my research, I think you need to use the installer-desc and have an implementation in ExtensionInstallerService.
    Refer to the JNLP specifications. I havent tried to implement that yet, but will update here if I get anywhere.
    Cheers

  • When I open Firefox I have to try several times because a Runtime Error with the program C:\Windows\System32\regsvr32.exe

    when I open Firefox I have to try several times because a Runtime Error with the program C:\Windows\System32\regsvr32.exe

    '''Try the Firefox Safe Mode''' to see how it works there. The Safe Mode is a troubleshooting mode, which disables most add-ons.''
    ''(If you're not using it, switch to the Default theme.)''
    * You can open the Firefox 4.0+ Safe Mode by holding the '''Shift''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Don't select anything right now, just use "Continue in Safe Mode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shift key) to open it again.''
    '''''If it is good in the Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one.
    Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''

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

  • I am trying to reinstall Windows on my macbook pro.  I downloaded the support files and Windows 7 iso file to a USB drive.  However, when I try to run the setup.exe program I get the message "this program cannot be run in DOS mode."

    I am trying to reinstall Windows (would not launch).  I removed the partition and started over.  I downloaded the support files and Windows 7 iso file to a USB drive.  However, when I try to run the setup.exe program I get the message "this program cannot be run in DOS mode."  I was successful before, what am I doing wrong this time?

    Try a restart.
    If that doesn't fix the problem, shut down the computer and then power it back up. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart by using the application unistaller. For each disable/delete, you will need to restart if you don't do them all at once.
    Safe Mode
    Safe Mode - About
    General information.
    Isolating issues in Mac OS X
    Troubleshooting Permission Issues
    Step by Step to Fix Your Mac

  • I need help moving my Photoshop 7 from my old laptop to my new laptop which is running Windows 7 Enterprise.  I've tried two routes unsuccessfully.  I install the CD, it does not autoplay.  I execute Autoplay.exe at the root directory, I am welcomed, I ch

    I need help moving my Photoshop 7 from my old laptop to my new laptop which is running Windows 7 Enterprise. I’ve tried two routes unsuccessfully. I install the CD, it does not autoplay. I execute Autoplay.exe at the root directory, I am welcomed, I choose English, I accept the EULA, I get the Install/Explore choices window, with the Install button already selected, I click the Photoshop button, the CD spins, and nothing happens.  In the 2nd attempt I execute Setup.exe in the Photoshop directory, and nothing happens at all.  I’m never even offered the opportunity to enter my product code. What should I do?

    There could is likely a compatibility problem between the old software and the newer operating system.

  • How to execute a exe file using javascript on app window.load.

    How to execute a exe file using javascript on app window.load.

    Hi sb00349044,
    As I have already mentioned in multiple replies to your previous questions, the SUMO forums focuses on providing help to end users with usage-questions and issues.
    For developer-related questions, please refer to one of the many resources readily available that I have linked to in the past:
    * [https://developer.mozilla.org/en-US/Firefox_OS MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os StackOverflow]
    * [https://lists.mozilla.org/listinfo Mozilla Mailing Lists]
    - Ralph

  • Executing external programs in Windows from UNIX

    Hi all,
    I would like to call an external program in Windows box from UNIX box. I tried to create a command in SM69, specify the command and OS type to Windows. When I try to execute the command in SM49, I got an error 'program_start_error'.
    I tried also to create an RFC destination in SM59, using connection type = T (start external program via TCP/IP), specifying the program in the Program field and specify the Windows box hostname (or IP add) in the Target host. But this also seemed could not work.
    Is there any other ways I could do this?
    Thank you.
    Mizwan

    <b>RSBDCOS0 Execute UNIX commands. </b>
    Look at <b>SM69, SM49</b> and
    Function <b>SXPG_COMMAND_EXECUTE</b>
    e.g. SM69
    Press F5 or click Change button
    Press F6 or click Create
    Fill in the following parameter :-
    Command name                                        - the unix scripts file name e.g. ZABAPFTP
    Operating system command                       - e.g. sh
    Parameters for operating system command - e.g. /sap_production/usr/sap/trans/data/zabapftp.sh
    REPORT  ZABAPFTP.
    data : t_btcxpm      like btcxpm occurs 0,
             p_addparam like sxpgcolist-parameters,
             rep_date       like sy-datum,
             t_date           like SXPGCOLIST-PARAMETERS.
    rep_date = sy-datum - 1.
    t_date = rep_date.
    *p_addparam = '/sap_production/usr/sap/trans/data/zabapftp.sh'.
    refresh t_btcxpm. clear t_btcxpm.
    call function 'SXPG_CALL_SYSTEM'
         EXPORTING
              commandname                = 'ZABAPFTP'
              additional_parameters      = t_date
         TABLES
              exec_protocol              = t_btcxpm
         EXCEPTIONS
              no_permission              = 1
              command_not_found          = 2
              parameters_too_long        = 3
              security_risk              = 4
              wrong_check_call_interface = 5
              program_start_error        = 6
              program_termination_error  = 7
              x_error                    = 8
              parameter_expected         = 9
              too_many_parameters        = 10
              illegal_command            = 11
              others                     = 12.
    if sy-subrc ne 0.
       write:/ 'Error in ZABAPFTP ', sy-subrc.
    endif.
    regards
    vinod

  • Executing  .exe program

    I've tried to write code like this :
    r.exec("c:\my documents\Ccode.exe");
    where r is an instance of Runtime class, but then
    nothing happen and my DOS - Promt became hang.
    I wrote the Ccode in C.
    Anyone could help me how to run .exe program form java?
    thanks you very much in advance for your kindess
    regards,
    agus

    Thank you very much for your answer. But unfortunately my java program still unable to execute my C code. The C code is only simply write 'this c code will be called from java program' and then waiting for user keystoke ( by getch() code). There is no hang but an error message appear. What should I do ?
    best regards,
    agus

  • Execute Exe Program from SAP

    Hi SAP gurus,
    I have  a requirement where in we have a DOS exe Program but Dont have source code of it. The Program takes some input values, Calculates and Gives the output result. We need that Program to be called from SAP so that we can pass the input values from SAP and get the results back into SAP.
    It would be great if you can help me out in this. Answers will be rewarded.
    Thanks,

    Check FM WS_EXECUTE.
    REPORT ZEXAMPLE.
    DATA:       V_PGM(100) VALUE 'C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\WINWORD.EXE',
    V_FNAME     LIKE RLGRAP-FILENAME VALUE 'C:\DOCUMENT.DOC'.
    CALL FUNCTION 'WS_EXECUTE'
         EXPORTING
              COMMANDLINE          = V_FNAME
              PROGRAM        = V_PGM
         EXCEPTIONS
              FRONTEND_ERROR      = 1
              NO_BATCH            = 2
              PROG_NOT_FOUND      = 3
              ILLEGAL_OPTION      = 4
              GUI_REFUSE_EXECUTE  = 5
              OTHERS        = 6.
    IF SY-SUBRC NE 0.
      WRITE:/ V_FNAME, 'NOT OPENED WITH', V_PGM.
    ELSE.
      WRITE:/ 'EXTERNAL APPLICATION CALLED SUCCESSFULLY'.
    ENDIF.

  • What html code will start an EXE (program) with a click on a webpage link?

    The code in bold below worked. After I switched my browser from IE 11 to Firefox to get the hover on hotspots to work, the program gave me this error message. I moved the EXE file to my local file folder and tried it as shown below. Still no success. Any suggestions?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Family Tree Charts</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
    <!--
    body,td,th {
        color: #000;
    -->
    </style></head>
    <body link=blue vlink=blue>
    <table width="100%" height="25" border="0" cellpadding="4" cellspacing="0">
      <tr>
        <td width="93%" height="27" bgcolor="#EFEFEF"> <div align="center"><font color="#999999">
        <b>This Software Allows You To Review Neat Charts of Your Family Tree </b></font></div></td>
        <td width="7%" bgcolor="#CCFFFF"> <div align="center"><A href="Mementos_Menu.html"><font size="2">Back</font></a></div></td>
      </tr>
    </table><BR><center>
    <br>
    <FONT color=#ff00ff><strong>Click the link below to download a special software program for your PC.</strong></FONT><br>
    <br>
    <a href="http://jdmcox.com/"><strong>Cox Website</strong></a><br><br>
    <strong>ITEM 1</strong> (AT THIS  WEBSITE) IS  THE <strong>FAMILY TREE CHART</strong> PROGRAM.<br>
    It is called <strong>Simple Family Tree</strong><br>
    <table width="80%" border="2" cellspacing="2" cellpadding="2">
      <tr>
        <td width="49%" align="left" valign="top"><FONT color=#ff00ff><strong>Click the link below to use this special software program after you download and install the program.</strong></FONT><br>
    <br>
    <!--<a href="C:\Program Files (x86)\Simple Family Tree\Simple Family Tree.exe"><strong>Family Tree Charts Program by Doug Cox</strong></a><br><FONT color=#ff00ff>
    -->
    <a href="C:\Users\Tom and Polly\Documents\Genealogy CD\Simple Family Tree\Simple Family Tree.exe"><b>Family Tree Charts Program</b></a><br><br>
    <FONT color=#ff00ff><strong>Click  the &quot;run&quot; button for both warning messages.<br>
    Click the &quot;READ THIS!&quot; menu option when the program opens.<br>
    Click  "X" in the upper right to close the program.<br><br>
    You can update the family data in future years with this program too.</strong></FONT>
    <br></td>
        <td width="51%" align="left" valign="top"><FONT color=#ff00ff><strong>NOTE 1: Be sure your HTML code for this webpage has a proper line to link to the location where the software was installed. You can use NOTEPAD to make HTML code changes. My existing line is: </strong></FONT><br>
          "c:\<u>program files (x86)</u>\simple family tree\simple family tree.exe"<br><br>
          <FONT color=#ff00ff><strong>The underlined portion will need to agree with where the program was installed. Just change the directory (see underlined sample above). Good luck. If I am still living, call me.<br><br>
          NOTE 2: After you download, install, and try to use the program, you may get an error message window that looks like this -&quot;0 FAMS @F191 @ FAM&quot;. This means you have an individual record in your GEDCOM file that does not have a parent. Be sure all GEDCOM records have at least one parent even if you must name the parent UNKNOWN.</strong></FONT></td>
      </tr>
    </table>
    <br></center> 
    <table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#CCCCCC">
        <tr>
          <td bgcolor="#EFEFEF"> <font size="2">&copy;2002 Sales and People</font></td>
        </tr>
    </table></body>
    </html>

    Herbert:
    Here is my latest code attempt, but I get messages about the lines in BOLD that I do not understand.
    Perhaps you will see what I need to fix. Sure appreciate what you have found and shared with such a neophyte (aka dumbo).
    Tom
    <!--
    body,td,th
    -->
    function RunExe(path) {
    try {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf("msie") != -1) {
    MyObject = new ActiveXObject("WScript.Shell")
    MyObject.Run(path);
    } else {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    var exe = window.Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
    exe.initWithPath(path);
    var run = window.Components.classes['@mozilla.org/process/util;1'].createInstance(Components.inteinterfaces.nsIProcess);
    run.init(exe);
    var parameters = ["/c start Simple Family Tree.exe"];
    run.run(false, parameters, parameters.length);
    } catch (ex) {
    alert(ex.toString());
    This Software Allows You To Review Neat Charts of Your Family Tree
    Back
    Click the link below to download a special software program for your PC and your GED file.
    *Cox Website*
    ITEM 1 (AT HIS  WEBSITE) IS  HIS FAMILY TREE CHART PROGRAM.
    It is called Simple Family Tree
    Click the link below to look at my GEDCOM file contents.<br>Instructions are provided in the READ THIS menu option at the top of the window.
      *Show Yarnall Chart*
    *Return to this webpage by clicking on the backarrow after looking at the chart.
    You can update the family data in future years with this program too.*
    ©2002 Sales and People
    Date: Thu, 2 Jan 2014 02:09:18 -0800
    From: [email protected]
    To: [email protected]
    Subject: What html code will start an EXE (program) with a click on a webpage link?
        Re: What html code will start an EXE (program) with a click on a webpage link?
        created by Herbert2001 in Dreamweaver support forum - View the full discussion
    Perhaps this might be helpful:
    https://addons.mozilla.org/en-US/firefox/addon/opendownload-10902/
    It allows executables in Firefox to be run - it is an extenstion, though, so it must be installed in Firefox before your page will work.
    Another option is this solution, but it will still require a manual change in Firefox:
    http://forums.mozillazine.org/viewtopic.php?f=19&t=803615
    Or this: http://stackoverflow.com/questions/6472435/running-exe-in-firefox-why- do-i-get-an-error
    However, you will still have problems with getting it to work cross-browser. Honestly, browsers are not supposed to have access like that to the client side file system, which absolutely makes sense for the web.
    That is why you may have to approach the solution from a different angle - perhaps create a server side cloud version of your application(s) which can be easily accessed and run by your family members. I believe you used C to develop the applications? Although I have no experience with this framework, Wt might be a solution to convert your projects to server side applications:
    http://www.webtoolkit.eu/wt
    Good luck!
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5972893#5972893
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5972893#5972893
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5972893#5972893. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Dreamweaver support forum at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Adobe Reader 9.0 takes over most Exe. programs

    Help!  I am using Vista (can't change this). When I upgrade to Adobe 9.0, the links for most all Exe. programs are replaced by link to Adobe.  I note that others have referenced this problem for months. I can't believe I or anyone else is supposed to manually fix all the Exe. links. What's up with this?  What's the problem and the fix?  Thank you.

    I would just like to say again that this isNOT a Reader bug.  This is a Windows issue, most likely triggered by an issue with Windows Installer (which is used to install Reader).  You guys just happened to encounter it when you were installing Reader.
    Here is the actual Microsoft KB document covering this issue:
    http://support.microsoft.com/kb/555067
    Here for example is a link to the same problem with WordPad:
    http://www.tomshardware.com/forum/226825-46-help-files-converted-wordpad
    Two, there are several ways to fix this issue.  I also want to state that I have fixed this issue several times for others.  I have also intentionally caused this issue so that I could be sure that the fixes I used did work (Win XP, Win 2K and Win Vista).  From the above link:
    Method 1)
    Manually edit the registry to remove the default association with .exe files.  Here is the walk through from the MS KB:
    http://support.microsoft.com/kb/555067
    Here is the same walk through detailing how to do this on the MS forums:
    http://social.answers.microsoft.com/Forums/en-US/vistaprograms/thread/16be61fe-76ef-4b91-9 f60-3338cbcefb97
    Also please note this note at the bottom of the KB document:
    "Note: If you are using Windows XP and you enable "System Restore" , you need to
               disable "System Restore" in "Safe Mode" before using the instructions above."
    Here is how to enter Safe Mode (excerpt from MS KB doc):
    Restart the computer in Safe Mode
    To restart the computer in Safe Mode, use the appropriate method for your version of Microsoft Windows.
       1. Shut down, and then restart the computer.
       2. When you see the "Please select the operating system to start" message, press F8.
       3. On the Windows Advanced Options menu, use the ARROW keys to select Safe Mode, and then press ENTER.
       4. If you have a dual-boot computer or a multiboot computer, select the appropriate operating system from the list, and then press ENTER.
    For more information about Safe Mode, click the following article numbers to view the articles in the Microsoft Knowledge Base:
    (http://support.microsoft.com/kb/315222/ ) A description of the Safe Mode Boot options in Windows XP
    (http://support.microsoft.com/kb/202485/ ) Description of Safe Boot Mode in Windows 2000
    (http://support.microsoft.com/kb/180902/ ) How to start a Windows 98-based computer in Safe Mode
    Here is how to turn off system restore:
    http://support.microsoft.com/kb/310405
    Method 2)
    Open up a command line prompt.  This can be done by going to Start > Run.  In the Run box type, "cmd" and press enter.  (don't type the quotes).
    The rest is from the above post
    >>
    Reason is that your file associations has changed.
    From the command prompt, type:
    1. C:\>assoc|more <enter> --- this tells you the file associations that are in place
    2. C:\>assoc .exe= <enter> ---- this removes the association on .exe files
    >>
    More information can be found in this Microsoft KB document:
    http://support.microsoft.com/?id=323526

Maybe you are looking for

  • Creating A Directory

    In the tutorial "Building An Appliction", it states that the first step is: "Create a directory called divelog. Under the divelog directory, create another directory called images. For the Windows platform: C:\divelog\images". My question is, how do

  • Vendor code

    dear all, In SAP material code should be maximum of 40 characters. I wanted to add vendor code with that particular material due to which character range goes to 70 digits. do we have a provision to add vendor's material code in material master and a

  • Numbers: Copy/Paste from multiple tables into 1 single Table?

    I would appreciate some guidance in creating a copy/paste script from multiple numbers tables into a different single table within the same numbers document. The columns in the source table are in different positions to the destination table. So for

  • I need a button to go back to one/some screens. Jump 3 screens back totally impossible!

    You removed buttons forward/back. It's a pitty, I cannot jump back to some screens in stack. Regards Yuriy

  • Substitution pop-ups while trying to copy database

    I'm trying to use the "copy database" tool but some of my data contains ampersands (&) which is causing Sql Developer to open the substitution variable pop-up box. If I was in a worksheet I could do "set define off". How can I shut off substitution w