inet1.Execute GET How to use with Variable

If I have something like this, how can I insert Variables into the sections of code that contain the file names of the remote and local filenames?

  Easy point for someone I am sure.. Thanks for helping out a newbie...

.Execute "ftp://ftp.YourServer/YourURL", "GET YourFile.html
C:\YourDestination"
 
   
LVL 1
muchowebdotcomAsked:
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.

RuchiCommented:
this gives you an idea...

dim command as string

command = "get " & YourFile.html & "C:\YourDestination"

inet1.execute(, command)

0
RuchiCommented:
this gives you an idea...

dim command as string

inet1.url = "ftp://ftp.YourServer/YourURL"
inet1.username = yourusername
inet1.password = yourpassword

command = "get " & YourFile.html & "C:\YourDestination"

inet1.execute(, command)

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
muchowebdotcomAuthor Commented:
Did not work, I get the same result I got with my code, it logs onto the FTP server fine but does not actually execute the GET command. This only happens when I replace the file name with Variables. Another shot?

This is what I have so far and it does not work...

Private Sub Command2_Click()

Dim ftpaddress As String
ftpaddress = Text1.Text

Dim remotefile As String
remotefile = Text2.Text

Dim localfile As String
localfile = Text3.Text

Dim Command As String
Command = "GET " & localfile & remotefile

With Inet2
    .URL = ftpaddress
    .UserName = "MyUserID"
    .Password = "MyPassWord"
    .Execute , Command
   
End With

What does work is this:

..Execute ,"GET index.html c:\webstuff\index.html"

Thanks...
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

RuchiCommented:
this is to emplement th Execute method with ftp operations..

inet1.execute operationname file1 file2

i.e.
inet1.execute "FTP://ftp.yourserver/yoururl", "Get file1.txt c:\file2.txt"

0
muchowebdotcomAuthor Commented:
That is exactly what I did, I just don't have the FTP address specified because I specified it in the code just above. I already got the code to work by entering the file names intot hat line of code. As I explained, the problem comes in when I replace the file names of the remote and local files with Variables. I did get it to work with some info I got from somewhere.. FYI here is what worked.. I think it was a comma in the wrong place or something..

upthefile = "SEND " & localfile & " " & remotefile

..Execute , upthefile

SO this peticular issue is solved.. Thanks, don't know that you really solved my problem exactly but, all the effort you made is sure worth the points so here ya are.. Thanks again..

0
muchowebdotcomAuthor Commented:
How do I award the points/? I am lost.. They changed the way to do this since I last did it..

 
0
crazymanCommented:
Don't forget if any of the paths have spaces in them you will need to add
chr(34) to the begining and end of each path as the inet control takes a space as being the next paremter.
0
muchowebdotcomAuthor Commented:
Thanks, I have no spaces...
0
RuchiCommented:
You can accept the answer by selection accept comment as an answer.

Or I can give you another comments.


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.