WshShell not working in NAS

Jatin_Patel
Member Posts: 200
Hi,
I am working in NAV 2013 version.
WshShell is not working in NAV Application Server.
My code is as below:
IF NOT GUIALLOWED THEN BEGIN
WindowStill := 0;
BooleanReturn := FALSE;
IF ISCLEAR(Shellik) THEN
CREATE(Shellik,TRUE,TRUE);
Temp := '"C:\Program Files (x86)\WinRAR\WinRAR.exe" a -ibck F:\param.rar F:\param.txt';
X := Shellik.Run(Temp,WindowStill,BooleanReturn);
END;
It is working fine through RTC but gives error through NAS as below:
Microsoft Dynamics NAV
Microsoft Dynamics NAV Server attempted to issue a client callback to create an Automation object: 72c24dd5-d70a-438b-8a42-98424b88afb8 (CodeUnit 90000 test cu). Client callbacks are not supported on Microsoft Dynamics NAV Server.
OK
Is there any solution?
I am working in NAV 2013 version.
WshShell is not working in NAV Application Server.
My code is as below:
IF NOT GUIALLOWED THEN BEGIN
WindowStill := 0;
BooleanReturn := FALSE;
IF ISCLEAR(Shellik) THEN
CREATE(Shellik,TRUE,TRUE);
Temp := '"C:\Program Files (x86)\WinRAR\WinRAR.exe" a -ibck F:\param.rar F:\param.txt';
X := Shellik.Run(Temp,WindowStill,BooleanReturn);
END;
It is working fine through RTC but gives error through NAS as below:
Microsoft Dynamics NAV
Microsoft Dynamics NAV Server attempted to issue a client callback to create an Automation object: 72c24dd5-d70a-438b-8a42-98424b88afb8 (CodeUnit 90000 test cu). Client callbacks are not supported on Microsoft Dynamics NAV Server.
OK
Is there any solution?
Jatin Patel
Microsoft Dynamics NAV Consultant
Jatin's Blog
Microsoft Dynamics NAV Consultant
Jatin's Blog
0
Comments
-
I guess CREATE(Shellik,TRUE,TRUE); is opening a window to select always allow, allow once etc options to select.
Did you check by manually running?0 -
Yes it is working manually but not working in NAS.Jatin Patel
Microsoft Dynamics NAV Consultant
Jatin's Blog0 -
Jatin Patel wrote:Yes it is working manually but not working in NAS.
Hi
You cannot create a COM object server side and NAS Service is only service side (it don't have a client side or a RTC interface).
Your only solution is to recreate it with dotnet.
Something like:
ServerProcess is a local System.Diagnostics.Process.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'ServerProcess := ServerProcess.Start(ProcessName, Parameters); IF WaitExecution THEN BEGIN ServerProcess.WaitForExit; EXIT(ServerProcess.ExitCode); END;
Bye
MatteoReno Sistemi Navision Developer0
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