Dear All,
Regarding to the shell command which execute the external application.
SHELL('C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE');
But I really confused about the warning message which display when shell command will be called.
The warning message is...
"You are about to run the following executeable for the first time:
Executable:C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE
Parameter:
Please be aware that you may be running an executable that could potentially harm your computer.
Do you trust this executable and its parameter?"
I knows it will be display only at the first time, but I don't want it pop up anyway. How can I blocked this warnig message?????
Thank you in advance.
0
Comments
i found no way to solve this problem directly. the used commands are recorded in the zup-file, every command that is commited will not produce a warning until you delete the zup-file.
the problem increases if you work with varying parameters, e.g. doc names for word. the warning will appear once for every new shell string and client.
we did a workaround by using an ocx, which reveices and executes the command. :?
maybe you can download it from here on monday (depending on the velocity of our best webmaster).
the download is named "oyster". (it all tasts like shells
Dont know why this 1-time message bothers you but well here is a way to circumvent, create this function in Navision and use it instead of the standard shell function:
lclsShell is a local variable of type automation and subtype 'Windows Script Host Object Model'.WshShell
Jan-Pieter
Thank you for your help. But I still stucked in this problem. I'm waiting for your OCX , Toene. And I had tried to code follow Janpieter's sample, but it's not work properly. Maybe it is my misunderstand.
MyShell(RunApplication : Text[1024])
CREATE(lclsShell);
lclsShell.Run(RunApplication);
CLEAR(lclsShell);
This is the function which created in the codeunit and the function is called by the command button (on form). When I press the button , it will displayed the following error message :
"This message is for C/AL programmers:
An exception was raised in method run. The OLE controls or Automation server has returned error(HRESULT) -2147352567.
The component did not provide the exception description."
So what is my misunderstand? ](*,) Please suggest.
For example i can use:
and this works fine.
Maybe you must experiment with other applications (it may be the application you use causing an error). Also look at how you use slashes and if the path excist etcetera.
First , I wanna say "Thank you" to you all.
I had tried for every suggestion. First , I tried to code follow Janpieter's suggest. I found something!!! #-o It's works propery for the short path parameter. Coz I tried to execute the application which stored in the "c:\front" and it's works. But for the same application which stored in the other folder (eg. "C:\Program Files\Microsoft Business Solutions-Navision\Front" ) It's still pop up the error msg as I told you. Then I tried to use the ocx's tonne , and now it's works propery for all paths. \:D/
Thank you, Janpieter & Tonne. =D>
uto
May I add that perhaps the error message has nothing to do with Navision, but may come from firewall or virus protection programs running on the same system. :-k
Best Rgds
Torben
Pls define a automation variable called "laum_Shell",
Datatype = Automation
SubType = 'Microsoft Shell Controls And Automation'.Shell
Coding
=====
CREATE(laum_Shell);
laum_Shell.Open('C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE');
CLEAR(laum_Shell);
Thank you for your help. I had tried to do follow bestianhow's code and it's works fine. I don't need to remove the execute to the others folder and regist the ocx. I think the customer should prefer this solution. (I also because it can reduce my works
B.T.W. I think all solutions are good for the different situation. No one is the best but all are good.
Thank you for your helps. =D> =D> =D>
Uto
The Code from bestianhow works fine but i have a problem with parameters after the exe.
It doesn't run.
Can everybody help.
HMR
i find the follwoing note in the Late Changes documentation of Navision 4.0.
***
C/SIDE
The following changes have been made in C/SIDE:
SHELL Function
You use this C/AL function to execute external programs and operating
system commands.
The syntax for this function is:
[ReturnCode]:= SHELL(Name [, Param, ...])
In previous versions of Navision, you could pass the parameter(s) as part
of the Name argument – for example,
SHELL(“C:\Windows\Notepad.exe MyFile.txt”)
In Navision 4.0, you can no longer pass the parameter as part of the Name
argument. The name argument must be filled in and it must not contain
any parameters except for the executable. The parameter information must
now be hard coded into the system as a text constant or as a variable.
The SHELL function has been redesigned so that each user can create a
list of trusted executables. This list is maintained in the user’s zup file. The
way this function works depends on whether the executable is given as a
text constant or as a variable.
Text Constant
If the name of the executable is passed to the SHELL function as a text
constant the executable is trusted and the user is not prompted to confirm
that they trust the executable. This is also the case when the executable
(text constant) is called with a number of other arguments that have been
assigned manually.
Variable
If the name of the executable is passed to the SHELL function as a
variable the executable is not trusted and the user is prompted to confirm
whether or not they trust the executable the first time it is called. Once the
user has confirmed that they trust the executable it can be called again at
any time without their having to confirm that they trust it.
***
Hope this helps solving the problem.
thank you for your Message
Can i eliminate the message "run at first time" ?.
Every parameters to send with the exe are different.
It's nerves every time to close the Message.
Can everybody help.
HMR
Hello HMR,
I had the same situation : Executing external Programs with different Parameters - and I solved it using "Oyster" from the Download-section
The only thing is, that a the filetype has to be registered with some program.
Ok, so then my suggestion is to use an automation-variable. Three lines of code no security restrictions (as far as I know).
Beautiful!!! Thank you!
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
http://www.BiloBeauty.com
http://www.autismspeaks.org