Opening a windows explorer window from Nav 2009

Hello Everyone,

I’m opening a windows file explorer window from code in Nav-2009.
The problem is that the user is asked with a pop-up windows that warns against potential damage to the system (screenshot attached), some users get scared and don’t know what to do when this happens.
Here is the code am using in the trigger:

CommandProcessor := ENVIRON(‘COMSPEC’);
Directory := FORMAT(SalesSetup.“Customer Directory File Path”) + FORMAT(“No.”);
Argument := ‘/c’;
DOSCommand := ‘explorer.exe’;
SHELL(CommandProcessor, Argument, DOSCommand, Directory);

Is there a better way to do this avoiding the warning?

Thank you for reading!

0003.warning.png

What happens when user tries to open for second time ?

Does the user gets the same message second time.

After the first time doesn’t ask anymore, but only for that session, next time you open a new session it will ask again

Any other way to execute an outside program without receiving a warning?

I’m not certain that this will solve your issue, but in the past I have been able to resolve certain security nag issues by changing the User Access Control (UAC) settings on the client workstation. It might be worth a look.

hi,

executing the shell command with values gives that warning.

executing the shell command with parameters (text variables) works without that warning.

// variable: execResult | Integer
// Text Constants:
// TXT001 | c:\windows\explorer.exe
// params | /e,c:\temp

execResult := SHELL(TXT001,params);

the shell command is obsolete since nav 2009.

you can use the wsh (windows scripting host) instead, or the dotnet class System.Diagnostics.Process (part of the System.dll assembly).

follow http://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx

regards

Jonathan, thank you for your time and for sharing your knowledge!

Hi, thanks for your answer, I believe that the warning is not related to UAC because it behaves the same way in Windows XP that has no UAC.