NAV 2013 - Shell is not working

rchikka
Member Posts: 23
Hi All,
We are using NAV 2013.
We are simulating data transfer using ftp from Head Office to Store..
The files willl be exported via XML and will get placed into FTP using Wshshell successsfully.. However while downloading the files from FTP Folder, the wshshell is not calling the batch file ?
Name DataType Subtype
wSHShell Automation 'Windows Script Host Object Model'.WshShell
CREATE(wSHShell,false,ISSERVICETIER);
wshshell.run(uploadfiles) ; // uploadfiles is a text constant which calls the batch job (.bat)
upto to here.. it works fine.
similarly wshshell.run(downloadfiles) // download files is a text constant which calls the batch job ( .bat)
here the calling is not happening..
however if we do run the batch file (.bat) file manually, then it works successfully.
not able to make it out whether am i missing something or is there any problem with wshshell call itself ?? if so how to fix it ?
Kindly suggest ?
We are using NAV 2013.
We are simulating data transfer using ftp from Head Office to Store..
The files willl be exported via XML and will get placed into FTP using Wshshell successsfully.. However while downloading the files from FTP Folder, the wshshell is not calling the batch file ?
Name DataType Subtype
wSHShell Automation 'Windows Script Host Object Model'.WshShell
CREATE(wSHShell,false,ISSERVICETIER);
wshshell.run(uploadfiles) ; // uploadfiles is a text constant which calls the batch job (.bat)
upto to here.. it works fine.
similarly wshshell.run(downloadfiles) // download files is a text constant which calls the batch job ( .bat)
here the calling is not happening..
however if we do run the batch file (.bat) file manually, then it works successfully.
not able to make it out whether am i missing something or is there any problem with wshshell call itself ?? if so how to fix it ?
Kindly suggest ?
0
Comments
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
You can use dotNet
Create this 2 variables:
WShell DotNet System.Diagnostics.Process.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
ProcInfo DotNet System.Diagnostics.ProcessStartInfo.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
and the next code:
ProcInfo := ProcInfo.ProcessStartInfo;
ProcInfo.FileName := 'here program to exe';
ProcInfo.Arguments := 'here the parameters';
ProcInfo.UseShellExecute := FALSE;
ProcInfo.RedirectStandardOutput := TRUE;
ProcInfo.WindowStyle := 1; // Hidden
ProcInfo.CreateNoWindow := TRUE;
WShell:= WShell.Start(ProcInfo);
WShell.WaitForExit;0 -
An alternative...
Within the Microsoft.VisualBasic.Interaction namespace is the Shell method, MSDN here http://msdn.microsoft.com/en-us/library/f92d6y8s(v=vs.110).aspx
Using this method you can create a process without using the additional code.
Define two variables:
vbShell of DotNet using Microsoft.VisualBasic.Interaction.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
vbAppWinStyle of DotNet using Microsoft.VisualBasic.AppWinStyle.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
The C/AL code required is as follows;vbShell.Shell('c:\somedir\somefile.exe', vbAppWinStyle.Hide, FALSE, 0);
Much simpler but less control.
Enjoy 8)0
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