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??
0
Answers
I guess double quotes ("").
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...
RIS Plus, LLC
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.
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...
You need to hit F1 and you'll the documentation.
Basically parameters need to be passed separately
SEHLL('FTP.EXE',pARAM1, pARAMETER2);
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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
Thanks for the follow up, that's what makes this a very valuable post :thumbsup:
RIS Plus, LLC