Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Running DOS FTP from VB 6.0

Posted on 2000-02-23
5
Medium Priority
?
308 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
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 300 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

916 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