Problem with shell instruction and path

markyTmarkyT Member Posts: 120
Hello, I've the followin code:

IF "Vendor No."='1999' THEN
SHELL('c:\windows\explorer.exe', '\\SERVER\Sales\\BMB');

This code is in OnPush from a commandbutton on Item label, and compares the vendor number and goes to a path from my network and opens a folder with several information from vendor. It's simply and runs perfectly.
The problem is, that, some users, works with terminal server sesions in a W2000 O.S., and, in Windows 2000, the path from shell command is winnt\explorer.exe, then, they can't open the folder because Navision doesn't find the windows folder. How can I do it to works in boths systems?.
Thanks in advance.

Comments

  • KYDutchieKYDutchie Member Posts: 345
    Hi,

    You can use the ENVIRON function for that.

    For instance create a local text variable called 'lv_win_path'.
    lv_win_path := ENVIRON('WINDIR');
    if COPYSTR(lv_win_path,STRLEN(lv_win_path),1) <> '\' THEN
      lv_win_path := lv_win_path + '\';
    
    Then change your shell command to be:

    SHELL(lv_win_path + 'explorer.exe', '\\SERVER\Sales\\BMB');

    This should work.

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • markyTmarkyT Member Posts: 120
    Fantastic!! =D> , it runs perfectly. Thanks for your help and time.
Sign In or Register to comment.