Call an executable

somebody know how I can call an executable from a Java program

Process p = Runtime.getRuntime().exec("sh /etc/rc.d/rc.local");Good Luck

Similar Messages

  • Calling LrTasks.execute from within a plug in manager control

    I'm working on a Lightroom post-processing-filter plug in which has most of the functionality inside an executable that resides inside the plug in folder.
    The executable is responsible for doing the actual photo processing but is also responsible for obtaining and verifying that there is a valid license. This means that I need to let the user eneter an activation code, pass that to the executable which will talk to our server and get a license.
    I would like to handle that activation part from the plug-in manager dialog so I've added a top section (see following code) with a text field and a button and I've added code to call the executable when the button is pressed, but the executalbe is never called.
    Is what I'm trying to do impossible? Any workarounds?
    Thanks in advance!
    Eyal
    function PluginManager.sectionsForTopOfDialog( f, p )
              p.my_result = 0
    return {
              -- section for the top of the dialog
                        bind_to_object = p,
                        title = "MyPlug",
                        f:row {
                                  spacing = f:control_spacing(),
                                  f:static_text {
                                            title = LrView.bind( "my_result")
                                  f:push_button {
                                            width = 150,
                                            title = 'Run Exe',
                                            enabled = true,
                                            action = function()
                                                      command = '"' .. LrPathUtils.child(LrPathUtils.child( _PLUGIN.path, "mac" ), "MyTool" ) .. '" ' .. '-action check"'
                                                      quotedCommand = command  
                                                      p.my_result = LrTasks.execute( quotedCommand )
                                            end,
    end

    Thanks Rob,
    I'm afraid it didn't work for me. The code inside postAsyncTaskWithContext is not executed, as far as I could see. I didn't see any diagnostic messages.
    local LrView = import "LrView"
    local LrHttp = import "LrHttp"
    local bind = import "LrBinding"
    local app = import 'LrApplication'
    local LrPathUtils = import 'LrPathUtils'
    local LrTasks = import "LrTasks"
    local LrDialogs = import 'LrDialogs'
    local LrRecursionGuard = import 'LrRecursionGuard'
    PluginManager = {}
    function PluginManager.sectionsForTopOfDialog( f, p )
              p.my_result = 0
              local buttonGuard
    return {
              -- section for the top of the dialog
                        bind_to_object = p,
                        title = "MyPlug",
                        f:row {
                                  spacing = f:control_spacing(),
                                  f:static_text {
                                            title = LrView.bind( "my_result")
                                  f:push_button {
                                            width = 150,
                                            title = 'Do Something',
                                            enabled = true,
                                            action = function(button)
                                                      LrFunctionContext.postAsyncTaskWithContext(button.title,function (context)
                                                                p.my_result = 3
                                                      end)
                                            end,
    end

  • Exception: Call of execute(String) is not allowed for PreparedStatement

    Hi all,
    This query was run fine on SapDB 7.4 from Jave code using prepareStatement()  method:
    declare id11216053819634 cursor for select sc.name, measuredobjectid id from serviceconditions sc, measuredobjects mo where sc.collectionid = mo.collectionid and sc.name like 'DWindowsSLA/%,%,%,%' for reuse
    declare id21216053819634 cursor for select min(sampletime), max(sampletime), name, id11216053819634.id from id11216053819634, d_slastore ss where id11216053819634.id = ss.measuredobjectid and ss.sampletime between '2008-07-14 00:00:00' and '2008-07-14 12:43:35'  group by name, id11216053819634.id for reuse
    select ss.status, ss.statuschange, ss.sampletime, id21216053819634.name from d_slastore ss, id21216053819634 where ss.measuredobjectid = id21216053819634.id and ss.sampletime between '2008-07-14 00:00:00' and '2008-07-14 12:43:35'  and (statuschange != 0 or ss.sampletime = id21216053819634.expression1 or ss.sampletime = id21216053819634.expression2) order by name, sampletime
    We recently upgrade our old SapDb to the latest MaxDB. An now this query produces the error:
    com.sap.dbtech.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Call of execute(String) is not allowed for PreparedStatement.
    Does anyone know how to fix this?
    Thank you very much,
    Irina

    Hi Irina,
    First, welcome to SDN!
    Well, PreparedStatement represents a precompiled SQL statement, so you should be using the no-arg execute() method rather than execute(String).
    HTH!
    \-- Vladimir

  • Calling and executing a function module in the Portal iview development

    Hello Portal development gurus...
        I am very new to portal iview development and am learning a lot of stuff.. I now have a requirement to do the following:
      1. I need to use the NWDS to create java code in developing an iview
      2. I need to call and execute a function module and display the parameters pulled in from the function module onto a Jsp.
    3. I need to create an iview based on this deployed component.
    Could anybody please explain me how to do the coding on this front?
    I appreciate if anybody can share documentation about this kind of a development.
    As always, points galore for useful and helpful suggestions.
    Regards,
    ~~~LB

    Hi,
    Firstly Have you searched in SDN for the same, anyhow please go through the link to work on the requirement
    [/docs/DOC-8061#15|/docs/DOC-8061#15]
    Go through the thread which will talk in detail
    [https://forums.sdn.sap.com/click.jspa?searchID=19551584&messageID=6348955|https://forums.sdn.sap.com/click.jspa?searchID=19551584&messageID=6348955]
    Hope this helps.
    Cheers-
    Pramod

  • Need to track Function modules called when executing a transaction

    Hi All,
              Is there a way through which i can track function modules called, while executing a Transaction. Kindly provide pointers to it.
    Thanks in advance.
    Regards,
    Navin.

    Goto SE80 Transaction and use Program name for corresponding Transaction Use Find operation like Call Function .. then you will get list of FM ..
    There is no other option .
    reward Points if it is helpful
    Thanks
    Seshu

  • Call an executable program inside function module and pass the table values

    Hi,
           i'm pretty new to HR Abap programming. I have a requirement like "calling an executable program within a function module and the output of the program data(Stored in internal tables) should be passed to the function module tables".
    I've some idea about SUBMIT keyword and i used it in the function module..
    Please do the needful to solve this.
    Regards,
    Selvi.

    Hi,
    Thanks for all your reply.
      I've used Option 3 as per dsouzajovito suggestion. Now i'm getting data in function module tables using import/ export table to memory concept.
    Again a small issue arises, while i'm executing function module it fetches all pernr available in the server and displays the details of last pernr. GET pernr statement is used in the Z report and submit statement is used like this as follows.
      SUBMIT ZHR_RFC_PAYSLIP   WITH  PERNR-PERNR EQ EMPCODE
                                          WITH PYBEGDA EQ FDATE
                                          WITH PYENDDA EQ LDATE
                                          AND RETURN.
    Pls suggest if there is any corrections in the code.
    If i give a pernr as input in the function module, then it should fetch the details related only to that pernr.
    FYI, No selection screen is used here as per requirement.
    Regards,
    Selvi.

  • Calling an Executable program in a Web dynpro

    Hi
    We would like to change the initial screen of one of our functionalities (kilometre claims), but the info after you submit the selection info does not need to change.  We have an executable program with the detail of the screen.
    I created a new Web dynpro application with the select options that must be entered; if you then click on a Submit button, I would like to call the current executable program, but I am not sure how I must do this.
    Example:
    To call a method, I always use: Call method ZCL_WD_PA=>ZHRPA_UPDATE_IT9004, but I am not sure how to call an executable program and with info is needed.
    Could anyone please assist?
    Regards
    Debbie

    Hi
    We have a functionality via Employee Self-Service (Portal ECC6) where an employee can view their Kilometre claimsin a Report format.
    To get the info to be displayed, someone else created a Program via the GUi SE38 (Attribute is an Executable program).  The front screen (selection screen) where the dates for which you would like to run the report for, needs to be changed.  It is not a nice screen to look at.  On that same screen which I would like to change, is a submit button.  If you click on that, it shows info and that info must not be changed at all.
    So I will also have a submit button on my new Web dynpro functionality where I am building hopefully a nicer selection screen.  I will also have a Submit button and I wanted to add something when clicking on this submit button to call the existing program that will show the info selected.
    Regards
    Debbie

  • Can we call and execute a request set using db adapter or oracle apps adapt

    Hi,
    Can we call and execute a request set(which executes a set of packages in a sequence) using db adapter or oracle apps adapter similar to calling a stored procedure and concurrent program?
    thanks,
    RV

    1) In BPEL call the DBAdapter in a sequence, make sure you set the partnerlink 'property' to transaction=participate.
    2) Or create a package that calls the other packages in a sequence
    Marc
    http://orasoa.blogspot.com

  • How TO CALL c++ EXECUTABLE FROM XI(VERY iMPORTANT)

    hI ALL
    pLEASE DO GIVE SUGGESTIONS AND DOCCUMENTATION LINKS  THAT <b>HOW TO CALL c++ EXECUTABLE FROM XI</b> .THIS IS VERY IMPORTANT AND YOUR HELP WILL BE REWARDED.
    WITH REGARDS
    SUBRATO KUNDU

    Hi Subrato,
    AFAIK you can call C / C++ methods in Java using Java Native  Interface (JNI).
    Please refer the following links for how to do the same.
    <a href="http://www.nag.com/IndustryArticles/CallingCLibraryRoutinesfromJava.pdf">For C:</a>
    <a href="http://www.javaworld.com/javaworld/javatips/jw-javatip17.html">For C++:</a>
    Regards,
    Ananth

  • Cannot call the execute command from java code

    Hello,
    I like to add a new user via a java web service.
    Establishing a connection to the OC4J MBean server is no problem. I also can execute the commands 'listAllCommands' and 'help' on the MBean. But if i try to call the execute command, i always get an NoSuchMethodException. Looking at the MBeanInfos 'execute' is listed there as an operation.
    Can anyone explain this to me?

    Hi,
    I basically used the code described at http://download.oracle.com/docs/cd/B32110_01/web.1013/b28952/mbeans.htm#CIHFDJBJ to connect to the MBeanServer.
    To invoke 'execute' i used
    MBeanServerConnection con= jmxCon.getMBeanServerConnection();
    con.invoke(new ObjectName(MBEAN_NAME), "execute", new Object[] { COMMAND }, new String[] {});
    where MBEAN_NAME is the ObjectName of the CommandService MBean and COMMAND is a String like "identity add ..."

  • I need to press F1 and call a executable help file

    Hi everyone, how do i listen to a f1 key pressed event and call another executable help file (help.hlp). I've got an application based on swing. Thanks for your help !

    Well I do not use a hlp file, but I open an html document and go to a target via F1. See about setHelpContext, and de.must.util.help at http://www.must.de/Jacompe.htm

  • How to make system call to execute command line in JAVA?

    Hi,
    I am new in JAVA. How to make system call to execute the following command line in JAVA in LINUX environment.
    rpm -qa jdkIn C programming, use as such:
    system ("rpm -qa jdk");
    How about JAVA?
    Thanks.

    Runtime.getRuntime().exec. But first read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Error :  while calling CL_GUI_FRONTEND_SERVICES= EXECUTE

    HI Expert,
    I am calling CL_GUI_FRONTEND_SERVICES=>EXECUTE in a RFC for running a Java program.This Java program converts a GIF image to Bitmap.
    When i execute this RFC (containing method) manually then there is no problem and it works perfectly but when the same RFC  is called through outside means from Java code then it gives error - "Access via NULL Object reference".
    How to resolve the error.
    Regards,
    Abhishek

    Methods of class CL_GUI_FRONTEND_SERVICES would only work if you try to execute them form the SAP GUI. That's why your RFC works good when you are running manually.
    You can let your JAVA program handle the functionality which you are trying to achieve by running the EXECUTE method.
    Regards,
    Naimesh Patel

  • Call and Execute Multiple Windows of the same VI

    Hi,
    I would like to call and execute multiple windows of the same VI.
    Please take a look for my attached vi, and start from the 2x2.vi, i think you have to re-enter the file path to run (sorry for inconvenience).
    If I click the start button in different sub panels, the sub vi(Temperature Analysis.vi..& etc) should be called out in multiple windows, hold it, and run simultaneously.
    But now the problem is, the sub vi is called out 1 by 1 until it is finished prior the second sub vi is called.
    May I know how to solve that?
    Thanks.
    Attachments:
    My VI.zip ‏173 KB

    Hello TanTan
    1. Open the PopUpmain.vi and select the path of PopUp.vi
    2. Enter the number of popups and run the VI.
    Hope this attached VI will work as per your expection. Please select the less number of instances 
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet
    Attachments:
    PopUpMain.vi ‏12 KB
    PopUp.vi ‏8 KB

  • Calling an Executable that Requires DOS from Webpage

    Could anyone helpout with this. I am trying to call an executable from a webpage. The purpose is to collect some data, store them in some strings then based on that data call the DOS executable and fill in the switches. For example the executable is clemail.exe and the switches are -to [person to] -from [person from] -subject [subjectline] etc... The DOS line looks like this:
    clemail.exe -to [email protected] -from [email protected] -subject email sender -body This exe enables you to send an email from the DOS command line.
    Any suggestion would be appreciated.
    Thanks,
    George

    Could anyone helpout with this. I am trying to call an executable from a webpage. The purpose is to collect some data, store them in some strings then based on that data call the DOS executable and fill in the switches. For example the executable is clemail.exe and the switches are -to [person to] -from [person from] -subject [subjectline] etc... The DOS line looks like this:
    clemail.exe -to [email protected] -from [email protected] -subject email sender -body This exe enables you to send an email from the DOS command line.
    Any suggestion would be appreciated.
    Thanks,
    George
    U can do that using
    Runtime.getRuntime().exec ("clemail.exe -to [email protected] -from [email protected] -subject email sender -body ");
    remember to put the clemail in path or give the entire path.

  • Calling a executable from local system

    Hi All,
    Can we call a executable file stored on our "local" system? I know this goes against the 3 tier architecure but still lemme know.
    regards
    Puru

    hi
    good
    go through this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2d5a358411d1829f0000e829fbfe/content.htm
    thanks
    mrutyun^

Maybe you are looking for

  • Business Graphics - Bar Chart - How to make the height extendable

    Hi Experts, I have created Business Graphics UI element for my WD application which fetches data from R/3. I am displaying 1) Cost Element in Y-axis and Cost in X-axis. 2) I have set ChartType = Bar, height = 300, width = 830 When the no of cost elem

  • Compilation error in PL/SQL

    Hi All, Please find the strange query situation in PLSQL. If i run the query without PLSQL block (i.e. declar begin end) it runs well and insert data in table but if put the same query in PLSQL block it gives compilation error. Following is the spool

  • What's wrong with 10.4.7 upgrade?  (Serious Slow-down)

    Attempting to install iLife, was forced to upgrade the OS. (A new iMac G5) Ran "Updater" with the 150 mb upgrade. Now the iMac runs slow as molasses... MUCH slower than before the upgrade. I've fixed and verified the permissions twice. How can I spee

  • Is there a way to insert a clickable hyperlink in the long text of an order

    Is there a way to insert a clickable hyperlink in the long text of an order header instead of using the attachment option? Thank JAM Edited by: Jimmy Mendoza on Dec 6, 2010 8:48 PM

  • Compiling a Servlet that uses JavaBean

    I have a servlet that will get data from a JavaBean which is created before in a jsp file. While I trying to compile the servlet I am getting this message: --------------------Configuration: JDK version 1.3 <Default>-------------------- Command : "C: