Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

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)?

3 REPLIES

Run external executable from script

What version of UCCX is this for?

If it's for UCCX 8x, then the answer is "no".  Unless you intend to run that command remotely on another machine.  In that case you just need one of several methods available to you, for sending "commands" to third party servers.  E.g., A web page that runs a local script.

If it's for UCCX 7x or lower, and you have Enhanced or Premium licensing, then the answer is "maybe". I do not have a 7x system to try this on, but here is a working example of running a command line in Java: http://www.linglom.com/2007/06/06/how-to-run-command-line-or-execute-external-application-from-java/

If you do in fact have UCCX 7x or lower, please do try this out and let us know how you fair.  Good luck.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Run external executable from script

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();
           }
       }
}

Re: Run external executable from script

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.

In attach there is my script and java source for Notepad example.


Have you any suggestion?

Regards,

giovanna

442
Views
0
Helpful
3
Replies
CreatePlease login to create content