• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Running DOS FTP from VB 6.0

I have a VB program that uses DOS FTP to send/receive files.  My question is can I error trap so if the FTP process did not work, I can display an error message? Here is what I am currently doing:
dReturnValue = Shell("C:\Windows\FTP.exe -i -s:c:\FTPscr2.txt", vbMaximizedFocus)
The return value is not a consistent number so I can't use it in an If/Else statement.  It's value is around -330091 to -401225 without any consistency.  Any Ideas?
0
grnavarro
Asked:
grnavarro
1 Solution
 
lmcnealCommented:
Is there a specific reason that you are using DOS FTP?

You should be able to make a reference to Microsoft Internet Transfer Control (msinet.ocx), instantiate that and then you can do it all from with in the VB environment.

This reference will aloow you to both FTP and HTTP

Lyle
0
 
Erick37Commented:
In your code dReturnValue is the process ID.  If you want to retrieve the return value from ftp.exe use GetExitCodeProcess()

ex:

"HOWTO: 32-Bit App Can Determine When a Shelled Process Ends"

http://support.microsoft.com/support/kb/articles/Q129/7/96.asp
0
 
hesCommented:
You should think about using a ocx like the mabry ftp.
http://ww.mabry.com
0
 
Erick37Commented:
grnavarro?
Are you there?
0
 
grnavarroAuthor Commented:
I'm here.  I was just hoping some more comments/answers would come in.  The GetExitCodeProcess() was a viable solution.
Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now