Hello everybody,
I'm having just the same problem : trying to call a batch file, containing ftp command, give nothing.
The code is as follow (I did not actually wrote it myself):
Code:
X = 0
On Error Resume Next
X = Shell(App.Path & "\EnvoyerOF.bat ENVOI.xml")
If X = 0 Then
'sending failed
Else
'sending succeed
endif
We have of course verified right permission for the batch file... Furthermore, we tryed to replace its contents with a dumb call to cmd.exe: nothing happen... So this batch script is not executed;
One first hypothesis was about a path error. But if that file is suppressed, then the return value of shell goes to zero (showing that the invocation failed). So the path seem to be right, even if it isn't quote-protected...
Maybe some error about a space character in "C:\Program Files". Weird error anyway, as the call to Shell() doesn't return zero.
Then, we thought about security protection... There is actually some security checking when calling "unmannaged code"... But that's in .NET ! (
http://msdn2.microsoft.com/en-us/library/xe736fyk.aspx) This seem farfetched...
Finaly, one point is that the code run well on the machine where VisualStudio was installed... But not on our machine, where VS is *not* installed... Perhaps something about different version of a library, or a library installed with VS, that's not present on our production machine. But again, as Shell is something very basic, that seem farfetched.
--
Remi