Dos Commands

With my internet connection open, I download FTP files using the following commands at the DOS Prompt:

C:

CD\

FTP

Open ftpprv.ftpsit.net

myusername

mypassword

bin

get ftpfile.zip

How can I issue these commands using VB5?
derossAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GordonpCommented:
use the Internet Transfer Control,

and use code like -

With Inet1
        .UserName = "myusername"
        .Password = "mypassword"
        .Execute "ftpprv.ftpsit.net", "bin"
        .Execute , "get ftpfile.zip"
    End With


0
autCommented:
Alternatively, you can use the WinINet API (and avoild the INet control's overhead)
0
knipecCommented:
Another way might be to use a command line shell and run the FTP command. You can tell the FTP to run a script. This has the advantage of divorcing the script from the action so that multiple scripts can be used and/or the script can be modified without a recompile.
0
BelatucadrosCommented:
I'm not sure how exactly you want to do it, but you could jsut make that a .bat file and shell to it....
Here:
shell("command.com /c PathandFileToRun Commuters CommandLine"), vbHide
' /c tells command.com to run a command and exit

 C ya!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
autCommented:
I have a comment:
In the accepted answer (from belatucadros), the idea of a batch file will not work!

The batch file will not allow statements that are meant for the ftp program (such as GET, BIN, and the username and password)!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.