Run external executable from script

Hi,
it's possible launch an external executable (Es. .\smsclient.exe "3201234567" "SMSClient.exe Tested on %date% at %time%")  from script .aef (not from CAD)?

Hi Anthony,
i have developed a Java class how you said me. I receive the sms, if run application from Eclipse. But if I invoke this class from script .aef not operate. For an simply example i have also created an Notepad example but not open pop up with notepad but also in this case if I run application from Eclipse all correctly function.
Above there is my script and java source for Notepad example.
Have you any suggestion?
***************************************SCRIPT testNOTEPAD.AEF********************************
Start
Do
          testpackage.Notepad AA = new testpackage.Notepad();
End
In console i read this output:
Begin Debugging C:\UCCX_Script_Esempi\TestNotepad.aef...
when i stop debug:
Done Debugging C:\UCCX_Script_Esempi\TestNotepad.aef.
but Nptepad.exe not running
*******************************************JAVA SOURCE ********************************************
package testpackage;
import java.io.*;
public class Notepad {
      public static void Main(String args[]) {
           try {
               Runtime rt = Runtime.getRuntime();
               Process pr = rt.exec("notepad.exe");
               BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
               String line=null;
               while((line=input.readLine()) != null) {
                   System.out.println(line);
               int exitVal = pr.waitFor();
               System.out.println("Exited with error code "+exitVal);
           } catch(Exception e) {
               System.out.println(e.toString());
               e.printStackTrace();

Similar Messages

  • How to run an executable from command-line

    I'm learning how to use the Terminal and I got stuck in a silly thing (I suppose it is). How can I run an executable file from command-line in Terminal?
    For example: I have a file named "Hello" in the folder /sample. If I use the ls command (ls sample), I can see the file Hello. Then I move to the directory (cd /sample) and try to run the file Hello (typing "Hello") but I got "command not found" message.
    If I drag the Hello file from Finder to Terminal and hit Return, it runs perfectly. And if I type the full path to the file (even if I'm already inside its directory), it also runs.
    So, my doubt is if there is any command to run an executable from command-line.
    Thanks

    KJK555 wrote:
    Hi VK:
    Can you enlighten me on why it's neccessary to do the "./" thingy in OS X when in unix/linux
    I never had to resort to doing that?
    Kj
    I took the trouble of reading *man bash* and it explains the issue. to add the current directory to PATH you need to add an empty path to PATH like this
    PATH=$PATH::
    you can add it to ~/.bash_profile so that it's executed automatically when you start bash. I suspect the linux system you are talking about had this set up by default or had it added to PATH in /etc/profile which defines PATH globally.

  • Passing Currency field to external subroutine from script

    Hi,
                I am passing one currency field to external subroutine from script. In subroutine we can get that currency in character format. I want to convert that into currency format. how can i do that?
    thnk u

    easy conversion:
    number = character_parameter

  • Can I use SubPanels to display and run multiple executables from the same GUI?

    I have two Labview executables that performs some A/D I/O, each using an independent USB-6008.  I would like to run both of these executables from a single UI.  Is this possible usin SubPanels?  Or some other method?
    I found KB regarding exe's and VI Server but can't seem to get the suggested workarounds implemented.
    http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C?OpenDocument
    I am using Labview2009
    Thanks
    Dan
    Solved!
    Go to Solution.

    DBerry wrote:
    No, of course I am not sure yet.  I have only begun testing this method. 
    Not sharing common hardware (separate USM-6008s).
    Here is the whole picture:
    I have developed a top-level VI that performs Daqmx IO using a single USB-6008.  The top-level VI references a Project Daqmx Task that points to the desired 6008.  I would like to create a single UI that uses this top-level VI to control twoUSB-6008s simultaneously.  I thought I could build the top-level VI into 2 separate exes, where the only difference between the exes is the hardware it points to (one exe to each of the 6008s).  But I have been unsuccessful at running these two exes within a single UI.  I attempted use subpanels on a tab control to do this but I am unable to obtain a reference to the top-level vis once they have been built into an exe.  I have also tried building a dll and exporting the top-level vi from the dll build but i can't seem to get that to work either.  In both of these cases my Open VI reference function returns errors (Error 1445).  I am aware of the changes in referencing VIs from within an exe/dll since LV8.2 - http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C
    The link seems to suggest that I should be able to obtain a reference to the top-level vi within the dll but I can't get it to work.
    So I then moved on to the above method (making all the subvis reentrant).  I just haven't figured this all out yet.
    If you have suggestions on other problems I may run into please share.  I think I can eliminate my FGs but haven't gotten back to this yet.
    Thanks
    Dan
    When I am designing apps of the type you described I have kept the ned goal in mind from the begining since of the issue you are mentioning. I also don't want to tell you to throw it all away and start over. So with that in mind I have been looking at your posts and only offering the least destrutive ideas first. With that in mind I would like to invite yo uto look at the code i posted in this thread (reply #18 has a zip).
    That code shows how to realize un-dockable GUI regions but it passes the ref of the top level VI to a reentrant VI it instanciate for each undockable region. It may have enough hints and technique to give you some ideas that will work for you.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Problems running external programs from java

    Hello.
    I wrote a pair of perl scripts and a GUI in java to run them. The first perl script just read the files in one directory makes some changes to the names of the files and then group all this files in a set of new directories. The other perl scripts takes all this new files and calls BLAST sequence alignment program and perform some alignments among these sequences. I tested this scripts and they work fine.
    The problem comes when I try to run them for the JAVA GUI. I use RunTime and when I need to run the first perl script it all works well, but when The call to the second perl script is made the program fisishes without doing anything at all. I found out that the problem is that when running the script from the Java GUI it's not able to find BLAST program. So I guess that Java is not really starting a terminal session and it doesn't read my bash_profile to find out the path to my programs.
    So, my question is if anyone knows a method to tell Java to load all this paths in the bash_proflie file so all of my scripts work???.
    I have no idea is this can be done and how so any advice would be really wellcome.
    By the way, my java version is 1.4.2 and my OS is Mac OS X 10.3
    Thanks a lot , Julio

    Invoke /bin/sh -c and give it your program's full path with.
    (To understand what I've written, maybe reading
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html
    http://mindprod.com/jgloss/exec.html
    and
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    (especially the exec(String[] cmdarray) method)
    might help)
    -T-

  • Running an Executable from a JAVA API in LINUX

    Hi,
    I want to run a C++ executable from my JAVA API in Linux. This is the sample of the code which i
    have used
    String[] arguments = new String[5] ;
    arguments[0] = "/usr/local/code/fun/dcmdump";
    arguments[1] = "+f";
    arguments[2] = "/usr/local/code/fun/240.dcm";
    arguments[3] = "+W";
    arguments[4] = "/usr/local/code/fun";
    Process p = Runtime.getRuntime().exec(arguments);
    On running the test file, the program seems to hang there. dcmdump is the name of my c++ executable and arguments [1] - [4] are its inputs. dcmdump should accepts these inputs and dump the contents of the file 240.dcm into the path mentioned by the last argument.
    But my program jst hangs. Is the the correct way to go about??
    Any suggestions or ideas r welcome!!
    Please let me know
    Thanks
    Dhaval

    Hi
    I did the following
    String[] cmd ={"/bin/sh","-c","/usr/local/code/fun/dcmdump","+f","/usr/local/code/fun/240.dcm","+W","/usr/local/code/fun"};
    Process p = Runtime.getRuntime().exec(cmd);
    When i execute my application, i see the following output
    [root@voltaire fun]# java TestRead2
    $dcmtk: dcmdump v3.5.3 2004-05-27 $
    dcmdump: Dump DICOM file and data set
    usage: dcmdump [options] dcmfile-in...
    parameters:
    dcmfile-in DICOM input filename to be dumped
    general options:
    I try to write the arguments in the command line when i execute but still get the same output.
    I dont think dcmdump is receving any arguements..
    Executing /bin/sh does it mean you have to mention the arguements in the command in the same manner that i have the String[] cmd??
    PLease let me know..
    Also i have put a Buffered reader to capture the output of dcmdump but I dont think i have reached my application has reached thr as yet. The code i have written is
    // put a BufferedReader on the output
    InputStream inputstream = p.getInputStream();
    InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
    BufferedReader bufferedreader = new BufferedReader(inputstreamreader);
    // read the output
    String line;
    while ((line = bufferedreader.readLine()) != null) {
    System.out.println(line);
    Please let me know your suggestions/ideas.
    thanks

  • DB recovery crashes when executed from script, finishes OK manually

    Hello everybody,
    I have a DB restore script which I used/tested a lot of times. On the last run it crashed in the archivelog recovery phase, but I was able to open the instance when applying the remaining commands manually.
    DB is a 10g2 on Solaris 10, I have a full backup made with EMC NetWorker. After taking the backup, the machine was re-installed from scratch (OS, additional 3rd party software, Oracle software and backup client). A new, empty DB instance was also created.
    Restore script performs the following:
    - checks/creates directory structure needed by Oracle instance;
    - stops the listener;
    - shuts down the new instance;
    - startup mount exclusive, enable restricted session;
    - drops database instance via RMAN
    - recovers the orapw, spfile, tnsnames.ora and listener.ora files from the backupset;
    - stars the instance in nomount;
    - replicates the controlfile from a saved copy in the backupset;
    - mounts the instance;
    - starts the following RMAN sequence:
    run {
    set until $LAST_SCN_IN_BACKUPSET;
    allocate channel c3 type 'sbt_tape' parms 'ENV=(....)';
    restore database check readonly;
    recover database check readonly;
    release channel c3;
    sql 'alter database open resetlogs';
    - starts the listener.
    Almost all is performed OK, until the "recover database check readonly" command, where the recover crashes with the following messages:
    Starting recover at 18-FEB-09
    starting media recovery
    channel c3: starting archive log restore to default destination
    channel c3: restoring archive log
    archive log thread=1 sequence=17
    channel c3: reading from backup piece 09k7hb2h_1_1
    channel c3: restored backup piece 1
    piece handle=09k7hb2h_1_1 tag=TAG20090216T181752
    channel c3: restore complete, elapsed time: 00:00:36
    archive log filename=<...>/oracle/oradata/SNM/arch/arch_1_17_678643049.arc thread=1 sequence=17
    released channel: c3
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 02/18/2009 19:58:19
    ORA-00283: recovery session canceled due to errors
    RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '<...>/oracle/oradata/SNM/arch/arch_1_17_678643049.arc'
    ORA-00283: recovery session canceled due to errors
    ORA-19755: could not open change tracking file
    ORA-19750: change tracking file: '/alcatel/oracle/oradata/SNM/bct.dbf'
    ORA-27037: unable to obtain file status
    SVR4 Error: 2: No such file or directory
    Additional information: 3
    Recovery Manager complete.
    The curious thing is that when I ran the following commands manually (from RMAN), the recovery was OK:
    run {
    set until scn $LAST_SCN_IN_BACKUPSET;
    recover database check readonly;
    (finished in a couple of minutes)
    sql 'alter database open resetlogs';
    (finished after a few minutes)
    lsnrctl start (from shell) - OK.
    Could somebody point me to the possible causes of this behavior?
    Thank you all for your time,
    Adrian

    Hi Werner,
    Thank you for your reply.
    Yes, I'm using the block change tracking file. As the DB instance was re-created when the machine was installed, the bct must have been created also. However, in my script I dropped the DB instance, and the bct was, most likely, deleted, as were all the other datafiles.
    After the restore script crashed, I had no bct file in the expected location (which is the location of all the datafiles).
    I'm wondering why the bct could not have been created during the run of the restore script.
    Looking through the alert log, I realise I tried an "alter database open resetlogs" before running the recovery sequence, and at that point, the bct was created.
    Then, the second attempt to open the instance was successfull - please see below the messages from the alert log:
    Thu Feb 19 09:43:47 2009
    alter database open
    Thu Feb 19 09:43:47 2009
    CHANGE TRACKING is enabled for this database, but the
    change tracking file can not be found. Recreating the file.
    Change tracking file recreated.
    Block change tracking file is current.
    ORA-1589 signalled during: alter database open...
    Thu Feb 19 09:43:54 2009
    alter database open resetlogs
    ORA-1196 signalled during: alter database open resetlogs...
    Thu Feb 19 09:48:04 2009
    alter database recover datafile list clear
    Thu Feb 19 09:48:04 2009
    Completed: alter database recover datafile list clear
    Thu Feb 19 09:48:04 2009
    alter database recover datafile list
    1 , 2 , 3 , 4 , 5 , 6 , 7 , 8
    Completed: alter database recover datafile list
    1 , 2 , 3 , 4 , 5 , 6 , 7 , 8
    Thu Feb 19 09:48:04 2009
    alter database recover if needed
    start until change 7033941 using backup controlfile
    Media Recovery Start
    parallel recovery started with 7 processes
    ORA-279 signalled during: alter database recover if needed
    start until change 7033941 using backup controlfile
    Thu Feb 19 09:48:05 2009
    alter database recover logfile '/alcatel/oracle/oradata/SNM/arch/arch_1_17_678643049.arc'
    Thu Feb 19 09:48:05 2009
    Media Recovery Log /alcatel/oracle/oradata/SNM/arch/arch_1_17_678643049.arc
    Thu Feb 19 09:48:43 2009
    Incomplete Recovery applied until change 7033941
    Thu Feb 19 09:48:43 2009
    Media Recovery Complete (SNM)
    Completed: alter database recover logfile '/alcatel/oracle/oradata/SNM/arch/arch_1_17_678643049.arc'
    Thu Feb 19 09:49:10 2009
    alter database open resetlogs
    <....>
    Thu Feb 19 09:50:47 2009
    LOGSTDBY: Validation complete
    Starting control autobackup
    Control autobackup written to DISK device
    handle '/alcatel/oracle/oradata/SNM/flash_recovery_area/SNM/autobackup/2009_02_19/o1_mf_s_679225849_4st3tswj_.bkp'
    Completed: alter database open resetlogs
    So, to recap:
    - bct file not created at first try (restore script);
    - bct file created during the failed attempt to open the db (manual command);
    - second attempt to open the db successfull (manual command).
    The behavior doesn't seem to be systematic, as I don't think this happens every time. In this case, I'm starting to wonder if it wouldn't be a good idea to disable the bct before starting the restore, and then to enable it back when the db is opened.
    Thank you again for your idea,
    Adrian

  • Running Java program from script shell using SSH

    Hello!
    I have this problem: I need to run a java command like: java Prog arg1 arg2 arg3 on i machines, using a shell script.
    First of all, I'm trying to make it work for a single machine. But the problem is when I write the line << ssh user@localhost "java -classpath /a/b/ Prog arg1 arg2 arg3" >> and run the script, it is not able to execute the entire line. Is there a special options for the arguments of my Prog class? I want to mention that between my arguments there is another text file which is read by the Prog and when i run the script says it cannot find that file; Please any ideas for not remain stuck here?
    Thank You in advance!

    Hello! Thank you for being so helpful..
    The part with << is not existent in my script, I've put it just here for quotation.Sorry
    So, from the terminal under Linux I run the command like this: I go to my folder where I have all my .java Classes and I execute the command java Prog arg1 arg2 arg3 . Where arg1...arg3 are arguments which are read from the terminal and then used in my Prog. One of the arguments is a text file, from which Prog.java reads line by line it's content. How can I run the same thing , under a script using SSH? This is basically my question, taking into consideration what I've written in my first post.

  • Firefox won't let me run and executable from the website-it wants to save it

    Looks like I lost all this information when I clicked to install the troubleshooter???
    again-- problem is I deleted old Internet Explorer and tried to install I.E. 8. With Firefox, I can't click download and choose run. When I click download I can only save.
    The saved download doesn't produce a file that works (it just tries to install I.E. , cleans off old files and restarts the PC OVER AND OVER.)
    I would like the choice to RUN a file instead of saving but I can't find out how to get this option back.
    I disabled all plugins, add ons, looked for possible limiting causes in Firefox to disable. STILL--I have NO CHOICE.
    Maybe this plea for help won't fix my problem and I will have to REPAIR windows--hate to risk it--I would have to back everything up, etc.
    Hopefully a simple answer to this question will solve my problem.
    Thank you to all who consider my question. I appreciate your time.
    Libby

    Hi--
    Thanks for the response. I was sure I used to have the choice to '''run '''or '''save '''when I started using Firefox and somehow I lost it with one of my adjustments. Forgot how or what I did!
    Before going back to Microsoft to try that I.E. program file again, I tried one more time to run it. That was the 5th time I tried to install I.E. from the saved file --and it worked!
    However, after that I tried to download an executable file from malwarebytes--- with and without my Kaspersky internet security program on--- the file RAN automatically anyway instead of insisting on SAVING!
    Maybe this was a microsoft issue?
    I am relieved that all is settled. Always try things 3 or more times is the rule with computers, right?
    But thanks for the tips--I may need them someday. Likewise the Safe mode w/ network support tip.
    ALSO--The page you referred me to was one I hadn't found with my own searching--it was much much better than the others. I bookmarked it.
    Thanks again...

  • Calling external executables from .jsx

    Hi
    I'm looking to do some Perforce (revision control) work from inside a Photoshop .jsx. There is a Perforce plugin for Photoshop but it does not seem to interface with the Photoshop CS2 Automation system in any way. My question is, does the Photoshop JS interface provide me some way to call other executables?
    Thanks
    Alex Mouton

    [email protected] wrote:
    > Hi
    >
    > My question is, does the Photoshop JS interface provide me some way to call other executables?
    There is no binary interface for this.
    However, the File.execute api will let you execute whatever app you want. If you
    need to pass parameter or get results back, it gets a little complicated but it
    is doable. Check over at the scripting forum.
    >
    > Thanks
    > Alex Mouton

  • Running external program from Form6i

    I have a Form 6i, client server application and from there I launch a window based help system, using Host command.
    Is it possible to run both the form application and the help program togather at the same time. As at the moment I need to close the help program to start using my Form based application.
    Regards
    EVA

    Hi,
    I had a similar query and got the following reply and it looks better. Attaching it for ur reference and hope it will help u.
    Thx.
    R. Magesh.
    Magesh
    unregistered posted May 15, 2001 08:25 AM
    Hi,
    Thx. for ur reply but I am already using the same host command and it is working fine. But we do have some problems in using the host command like u need to close the external application or o/s based application before working back in forms and also that I would like to use a generic html tag which can be opened in any default browser defined for the system rather than mentioning or invoking explorer explicitly. I am looking for any new builtin available in FORMS6I which can support web integration with the application.
    Thx.
    R. Magesh
    quote:
    Originally posted by Fan Liu ([email protected]):
    try this:
    http:
    host('explorer http://www.oracle.com');
    email:
    host('explorer mailto:[email protected]');
    IP: Logged
    Duncan Mills ([email protected])
    unregistered posted May 15, 2001 09:14 AM
    If you want to start a Host type command Asynchronously then you can use DDE.APP_BEGIN or the WinExec call in the D2KWUTIL library.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Eva Maria Villoria ([email protected]):
    I have a Form 6i, client server application and from there I launch a window based help system, using Host command.
    Is it possible to run both the form application and the help program togather at the same time. As at the moment I need to close the help program to start using my Form based application.
    Regards
    EVA <HR></BLOCKQUOTE>
    null

  • How can you run an executable from AS2 code without using fscommand() or a projector?

    Just using some short .asc files made out of Notepad for some back-end server stuff, but without using fscommand() or projectors, how can you call an executable? There's a C++ program that I want to run from more-or-less the same directory as the .asc files, which handles some logging, and I need to be able to pass it arguments when telling it to run.
    Please note that I have Googled this with no useful results and that I'm on an assignment that necessitates this question. Also I'm open to the possibility that it can't be done.
    Thanks!

    The swf is on a different server and using AS3.  The little bit of AS2 back-end stuff is on a few different servers that the swf is hooking up to for streaming video and audio.  The executable would be on the AS2 servers.

  • Running external executable in Photoshop CC 2014

    I am trying to link my panel buttons to external exe files, but I am having problems. I have tried two main approaches, opening the exe directly and then also running an external javascript file that then opens the exe.
    var oShell = WScript.CreateObject("WScript.Shell");
    var oExec = oShell.Run('D:/PhotoshopExporter.exe');
    But the debugger is telling me Uncaught ReferenceError: Wscript is not defined. I tried another method but it gave the same complaint, except regarding ActiveX

    I get an "app is not defined" error when I tried your method, so I guess you need more code than just what you supplied in your example.
    In any case this works fine and I don't see a reason to do it another way.
    var exec = require('child_process').exec;
    exec('C:/Windows/notepad.exe');

  • Running external applications from LabView

    Here are some very basic functions that allow you to start, close, minumize, and maximize external applications.
    Not much happening on the front panel, take a look at the block diagram.  The string constants are the title of the application as it appears on the title bar when the application is running.
    These functions use no other VIs as have been previously seen,  BUT they do use the user32.dll which is normally in the windows system32 directory.
    Best Regards
    -Tim C.
    1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
    Attachments:
    Read INI Polymorphic Type.zip ‏78 KB
    Controlling Application Windows.vi ‏22 KB
    Controlling Application Windows v80.vi ‏21 KB

    Hi Elvis,
    I took a look at that example and also found that it was built for SQL server, not necessarily Access. The difference is in the way it stores procedures. I have attached an example program that calls a stored procedure (or query) in Access on a sample database and gets called in LabVIEW. Please try this and let me know what you think! thanks
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments
    Attachments:
    StoredProcedureAccess.zip ‏23 KB

  • Running External Program From Flash

    Is it possible to open Windows calculator (calc.exe) from
    Flash much like the JumpOutReturn function in Authorware? My
    apologies if this seems like a simple routine.

    I'm rather new to Flash myself so I can't say whether Flash
    offers the ability to "open" a 3rd party application -- but
    considering what I've read I would venture to say the answer is
    "no". However, if you create (or use) a simple server, you could
    use Flash Sockets or XMLSocket to communicate with the server and
    have the server launch the application on your behalf.

Maybe you are looking for