use of 'wshShell' automation for RTC

RuubenRuuben Member Posts: 41
edited 2009-09-30 in NAV Three Tier
Hello i've been looking for an alternative way for 'shell' command (obsolete for RTC) and I found some posts where they explain how to use wshShell automation.

Using this posts i wrote this code:
CREATE(VarAutomation);
VarAutomationExec := VarAutomation.Exec(Parametros2);
VarExit := VarAutomationExec.Status;
WHILE VarExit = 0 DO BEGIN
  SLEEP(500);
  VarExit := VarAutomationExec.Status;
END;

CLEAR(VarAutomation);

*where Parametros2 = 'c:\myprogram.exe parameters'

When i run this in classic client it works but running this code in RTC next message is shown:

'This message is for C/AL programmers: The call to meber Exec failed: The system can not find the path specified'

i've executed this from the server and remotely and result is the same.

Does anybody know what's happening?

Thanks!

Answers

  • fitolfitol Member Posts: 46
    Ruuben wrote:
    When you create an automation like that it runs on the Service Tier.
    The Service Tier probably doesn't know what 'c:\myprogram.exe' is.

    To make it run on your local pc you must create it like this:
    CREATE(VarAutomation, TRUE, ISSERVICETIER);
    

    Then it may or may not work. You will have to try it. It depends on what you do with the automation.
  • RuubenRuuben Member Posts: 41
    Ey it works!!

    Lot of thanks!
Sign In or Register to comment.