Is there a way to start an RDP connection from NAV2017?

Stieven
Member Posts: 10
We want to start an RDP conection from NAV 2017. But we have no idea, if it is possible or what is the best way to do it.
0
Best Answers
-
You can start mstsc.exe using the Process .NET var
//Process System.Diagnostics.Process.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Process := Process.Process; Process.StartInfo.FileName := 'C:\Windows\System32\mstsc.exe'; // //optional Process.StartInfo.Arguments := 'connection path + file (.RDP)'; Process.StartInfo.UseShellExecute := FALSE; Process.StartInfo.RedirectStandardOutput := TRUE; Process.Start(); Process.WaitForExit();
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
No, I do not to put any code on pages, with the exception of code directly manipulating page properties. The code lives in a codeunit. But where it is located does not make any difference to whether it works, or not .
Just a note - the Process var should be marked as RunOnClient=Yes, as you do want to run the process on client machine, not on the server. You might also want to remove the Process.WaitForExit(); line
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
Answers
-
You can start mstsc.exe using the Process .NET var
//Process System.Diagnostics.Process.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Process := Process.Process; Process.StartInfo.FileName := 'C:\Windows\System32\mstsc.exe'; // //optional Process.StartInfo.Arguments := 'connection path + file (.RDP)'; Process.StartInfo.UseShellExecute := FALSE; Process.StartInfo.RedirectStandardOutput := TRUE; Process.Start(); Process.WaitForExit();
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
So I can set this code under a page action and when I call the action the RDP will start?0
-
try itSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
I want to create the local variable Process but when I want to select the dotnet assembly the typelist is empty.
0 -
I found a solution, I now start in the system assembly enselect then the right type in the type list.
Selecting the full path of the assembly directly doesn't work for me.0 -
I tried your solution but the program crashes when I tried it. It looked like the program was in an infite loop. I tried to debug the code but when I jumped to the second line of code the debugger crashes.0
-
Read the Process class documentation, learn what parameters do, play with them to get desired results. I am using this code to start various (command line) executables and scripts from NAV, it works for me.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Do you call this code from a page action? Beceause we tried this code but we can not get it to work.
It crashes on the first line of the code Process :=Process.Process .0 -
No, I do not to put any code on pages, with the exception of code directly manipulating page properties. The code lives in a codeunit. But where it is located does not make any difference to whether it works, or not .
Just a note - the Process var should be marked as RunOnClient=Yes, as you do want to run the process on client machine, not on the server. You might also want to remove the Process.WaitForExit(); line
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
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