Options

Navision 4.0 and SHELL

rkaufmannrkaufmann Member Posts: 71
Hi

in Navision 3.70 I use the following CAL Code to open files with their associated application.

>>Execute := STRSUBSTNO('start "" "%1"',"Filename incl. Path");
>>SHELL('cmd','/c',Execute);

This code uses the "start" command of the windows command shell to open a file with its associated application.

Now, when I use the exactly same CAL Code on an Navision 4.0 Client, I get the Error Message:

"The Operation systam cannot find the file 'cmd'."


I know I could use the CAL Command "HYPERLINK" instead, but the customer wants to store Links to external files using UNC paths.

When I use HYPERLINK with UNC Path, Internet Explorer opens and tells me, it cannot open the file.

Does anyone have a solution for that?
Solutions without using any third parity tools are prefered.

Bye,
Rolf

Answers

  • Options
    krikikriki Member, Moderator Posts: 9,090
    Try
    SHELL(ENVIRON('comspec'),'/C',Execute );
    

    or search the forum for "Windows Script Host Object Model" to avoid an anoying confirmation-box from MS.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    SHELL('cmd.exe', '/C', Execute);

    There is no executable 'cmd' file in OS :)

    Regards,
    Slawek Guzek.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • Options
    krikikriki Member, Moderator Posts: 9,090
    SHELL('cmd.exe', '/C', Execute);

    There is no executable 'cmd' file in OS :)

    Regards,
    Slawek Guzek.
    It seems that 4.0 doesn't search the PATH anymore, so you have to give the complete path and the environment variable in my previous post has the complete path.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    rkaufmannrkaufmann Member Posts: 71
    Tanks,

    using "SHELL(ENVIRON('comspec'),'/C',Execute );" works.

    Bye,
    Rolf
Sign In or Register to comment.