SHELL function in RTC

Beagle
Member Posts: 8
we have write a winform appliction which we want start from the RTC. In the classic Client we could start this application with the SHELL function and its works. In the RTC we get the Message that the SHELL function isn't supported. Is there any possibility to start a win application from the RTC?
Thanks,
Dominik
Thanks,
Dominik
0
Comments
-
Shell is an obsolete function in RTC. Instead you have to create a COM object and instantiate it using the CREATE function.
Troels Bent Hansen
Senior Program Manager
Microsoft Dynamics NAV
****** This posting is provided "AS IS" with no warranties, and confers no rights ******0 -
We use the following code:
_commandLine := 'C:\Test.exe';
_runModally := FALSE;
dummyInt := 1;
CREATE(wSHShell);
wSHShell.Run(_commandLine,dummyInt,_runModally);
CLEAR(wSHShell);
In the classic client it still works with this code . In the RTC nothing happens. We can see in the taskmanager that the process is started but the application is not display.0 -
Ok I found the solution. the above code works if I set the right parameter in the create function
_commandLine := '\\*.*.*RTC\programm.exe ' + "No."; _runModally := FALSE; dummyInt := 1; CREATE(wSHShell,false,true); wSHShell.Run(_commandLine,dummyInt,_runModally); CLEAR(wSHShell);
1 -
I would change it slightly to
CREATE(wSHShell,false,ISSERVICETIER);0 -
it's good to say that
Name DataType Subtype
wSHShell Automation 'Windows Script Host Object Model'.WshShell
other is clear =D>-Mihail- [MCTS]0 -
ok, but another but i got another problem... when I try to run app from network
i.e.:
_commandLine:= '\\server\folder\sample.exe';
an error msg appears:
"The call to member Run failed: No network provider accepted the given network path (Exception from HRESULT 0x800704B3)."
I have administrator acc. and full access.
Got any ideas why so..? Any settings that i may missed? :-k
Edit: I finaly found it:
when using network pathes the command line should be initialize like that '"\\server\folder\sample.exe"'; (the double quotes)-Mihail- [MCTS]1 -
Fantastic ! Thanks to you all for posting this - I've spent hours trying to solve this!
Chris1 -
This looks like just what I'm after! Could you let me know the C/AL Local declarations you used for _commandLine etc?0
-
compwizard wrote:This looks like just what I'm after! Could you let me know the C/AL Local declarations you used for _commandLine etc?
_commandLine -Text[1024]
_dummyInt - Integer
runModally - Boolean-Mihail- [MCTS]0 -
Hi,
I have the same problem, but my external apps/exe requires a parameter.
How can I pass a parameter?
Thanks0 -
Hi gunshy,
Please try with below code.Name DataType Subtype Length DNETSysDiagProcess DotNet System.Diagnostics.Process.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' //DNETSysDiagProcess.Start(string fileName, string arguments); DNETSysDiagProcess := DNETSysDiagProcess.Start('cmd.exe','/?');
Best Regards,
YukonMake Simple & Easy0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions