Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Command Shell to FTP files

Status
Not open for further replies.

Zukkster

Technical User
Mar 18, 2002
61
GB
I've read that you can use the command shell ftp functionality to FTP files to a site

I've hunted around a bit on the internet, but so far haven't managed to find the VBA code syntax that I would need to run this.

Also, I'm wanting to FTP many files and from what I can make out I need to make Access wait until each command shell execution has run before I execute the net line. The following code sample;


lays out how to do this but without knowing the code to excute the command shell in the first place I'm not sure how I'd integrate the code to pause.

Am I even going in the right direction?

Thanks
 
I would recommend the WshShell object and the .Run method within it. A short example:
Code:
    Dim Wsh As WshShell
    Dim lReturn As Long
    
    Set Wsh = CreateObject("WScript.Shell")
    lReturn = Wsh.Run("Notepad.exe", , True)
    MsgBox "Returned with " & lReturn

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
I would look into using the INet Control which has FTP capabilities built into it. It also has a StateChanged event to let you know when the each command is completed.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top