Unable to launch server file using RAD application ms.us.launch.external

Hi Experts,

We recently upgraded SM from 9.40 to 9.60. Our SM9.4 has linux server and new SM9.6 has Windows server.

We have a perl script in server and using ms.us.launch.external we fetch the file (in db-scripts) as : $L.ms.path.toperl="/v/campus/ny/appl/itservices/sm9/data/qa/sm94server/RUN/msemailQA.pl"

How do i launch the same file from windows server? The path for same perl script in windows server is : $L.ms.path.toperl="D:\Service Manager\Service Manager 9.6\RUN\msemailQA.pl". Getting error in sm.log as per attached screenshot. Kindly let me know how i can fetch the same file in server from client.

Green client is 9.4 linux which is working fine. And Blue client is 9.6 windows which is giving errors.

Any help would be appreciated. 

Thanks in advance.

  • Hi Ayushi,

    the path you use in Script seems to be different from the one in the log file. 

    Scipt : $L.ms.path.toperl="D:\\Service Manager\\Service Manager 9.6\\RUN\\msemailQA.pl"

    log file: RTE E Error starting /v/campus/ny/appl/itservices/sm9/data/dev/sm94server/RUN/msemailQA.pl
    RTE E Error 2 in call CreateProcess - The system cannot find the file specified.

    Check, if the path containing string "campus" is defined somewhere else. 

    Best regards,

    Heike

  • Hi Heike,

    Thank you for your reply.

    Please find below snapshots of log error and file path. 

     Below is the snapshot of launching the same file via db-scripts. The windows file path is within D drive. How to launch that via scripts?

  • Hi Ayushi,

    it depends what you are about to do with it?!

    Should the SM server part run it, and if needed use the response/output of that script?

    If so, you can use the sysExec in the JS parts of Service Manager:


    function runCommand(cmd) {
       var res = sysExec(cmd);
       if (res[1] != 0) {
          print('Warning:Command failed:', cmd);
       }

       return res;
    }

    With this JavaScript function you can run a command on the SM server itself. res is an array. If the command failed res[1] is different to 0.
    In res[2] you will see the response from the command, like if you would run the command from a cmd/shell.

    So to call your perl script should run via runCommand("<path to your perl script>") in case perl is directly recognized from your cmd. Or if not recognized you should call your perl script with runCommand("<path to your perl.exe> <path to your perl script>");

    Note: Please check yourself for escaping special characters and maybe the need of escaped qoutes in your command.

  • Let me explain the functionality for clear understanding.

    There is button as Send Email in a cm3r form, using which user can send email. Once submitted data is stored in SM table: msemailviaunix. Here there is a field as Email Processed which initially is set to 0. The perl script picks all records from this table whose value is 0 and sends notification to user. Once notif sent, the email processed is set to 1 by perl script. The perl script keeps checking this table via scheduler running in bg. This sch call the script and the script calls the perl script via ms.us.launch.external.