SHELL function and ftp.exe

Tintin25
Member Posts: 14
Hello
Facing a problem with a SHELL function in a report. The following code gives me a failure that a sign is not allowed: (Which sign is not defined)
ShellRetCode := SHELL('ftp.exe -s:' + Command_File);
where
Command_File := C:\DOCUME~1\sge\LOKALE~1\Temp\sendftp.txt
The txt-file sendfrp.txt include:
Open [ftp site]
username
password
cd upload/
put C:\DOCUME~1\sge\LOKALE~1\Temp\/1234.xml
quit
If I fired the following line off in cmd
'ftp.exe -s:C:\DOCUME~1\sge\LOKALE~1\Temp\sendftp.txt'
there are no problem and it uploads my xml file.
What am I missing??
Facing a problem with a SHELL function in a report. The following code gives me a failure that a sign is not allowed: (Which sign is not defined)
ShellRetCode := SHELL('ftp.exe -s:' + Command_File);
where
Command_File := C:\DOCUME~1\sge\LOKALE~1\Temp\sendftp.txt
The txt-file sendfrp.txt include:
Open [ftp site]
username
password
cd upload/
put C:\DOCUME~1\sge\LOKALE~1\Temp\/1234.xml
quit
If I fired the following line off in cmd
'ftp.exe -s:C:\DOCUME~1\sge\LOKALE~1\Temp\sendftp.txt'
there are no problem and it uploads my xml file.
What am I missing??
0
Answers
-
This one may be useful: viewtopic.php?f=32&t=31440What am I missing??
make it '"ftp.exe -s:C:\DOCUME~1\sge\LOKALE~1\Temp\sendftp.txt"'-Mihail- [MCTS]0 -
mihail_kolev wrote:This one may be useful: viewtopic.php?f=32&t=31440What am I missing??
make it '"ftp.exe -s:C:\DOCUME~1\sge\LOKALE~1\Temp\sendftp.txt"'
I already tried that...stil saying that a sign is not allowed...0 -
Have you tried the full path? So "Documents And Settings" instead of "Docume~1"?0
-
DenSter wrote:Have you tried the full path? So "Documents And Settings" instead of "Docume~1"?
Yeah, the thing is the path must not have any spaces and according to the documentation to fill the space you have to use something like this %~f0, and I think the problem is the sign "~".
But on the other hand I also tried just place the sendftp.txt and xml file in a local directory like c:\temp so the function call is SHELL('ftp.exe -s:C\Temp\sendftp.txt') - just hardcoded it. Again if I execute it from Nav it will give a error but if I execute from cmd: ftp.exe -s:C\Temp\sendftp.txt no problem.0 -
I assume ftp.exe can be called from any path? You haven't changed to that directory in the command prompt and then run it, right?0
-
matttrax wrote:I assume ftp.exe can be called from any path? You haven't changed to that directory in the command prompt and then run it, right?
Yep thats correct but I not sure if I follow you regarding changing directory. Can you give me an example?
We have just upgraded from a Navision 3.60 to a Nav 2009 version and I not sure SHELL function have changed...0 -
shell function has changed in 2k9.
You need to hit F1 and you'll the documentation.
Basically parameters need to be passed separately
SEHLL('FTP.EXE',pARAM1, pARAMETER2);0 -
Hello all
Thanks for all the help and you all lead me in the right direction.
The solution to my problem is:
ShellRetCode := SHELL('c:\windows\system32\ftp.exe', '-s:' + Command_File);
As noticed you have to specify the hole directory where ftp.exe is located and as ara3n pointed out the SHELL function have changed since (i'm just a junior consultant).
0 -
Tintin25 wrote:i'm just a junior consultant
Thanks for the follow up, that's what makes this a very valuable post :thumbsup: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