WshShell not working in NAS

Jatin_PatelJatin_Patel Member Posts: 200
edited 2013-12-09 in NAV Three Tier
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?
Jatin Patel
Microsoft Dynamics NAV Consultant
Jatin's Blog

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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?
  • Jatin_PatelJatin_Patel Member Posts: 200
    Yes it is working manually but not working in NAS.
    Jatin Patel
    Microsoft Dynamics NAV Consultant
    Jatin's Blog
  • matteo_montanarimatteo_montanari Member Posts: 189
    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

    Matteo
    Reno Sistemi Navision Developer
Sign In or Register to comment.