Solved

Running DOS FTP from VB 6.0

Posted on 2000-02-23
5
305 Views
Last Modified: 2011-10-03
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
Comment
Question by:grnavarro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:lmcneal
ID: 2552702
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
 
LVL 32

Accepted Solution

by:
Erick37 earned 100 total points
ID: 2552821
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
 
LVL 20

Expert Comment

by:hes
ID: 2553160
You should think about using a ocx like the mabry ftp.
http://ww.mabry.com
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2606288
grnavarro?
Are you there?
0
 

Author Comment

by:grnavarro
ID: 2608027
I'm here.  I was just hoping some more comments/answers would come in.  The GetExitCodeProcess() was a viable solution.
Thanks!
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question