|
-
Aug 22nd, 2002, 09:19 AM
#1
Thread Starter
Fanatic Member
inet1 Execute runs forever!
Hello, I have the following code.
Private Sub Form_Load()
With Inet1
.RemoteHost = "***.***.*.***"
.RemotePort = "21"
.UserName = "Administrator"
.Password = "********"
.Execute , "Put GallonageRpt.Exe C:\Program Files\GallonageRpt\"
End With
Do Until Inet1.StillExecuting = False
DoEvents
Sleep 1000
Loop
End
End Sub
When I run this, it does not error out. It does not copy the file, which is under 1 meg. It doesn't seem to do anything, but it says that the execute is still executing.
Anyone have any ideas on this?
thanks
-
Aug 22nd, 2002, 09:58 AM
#2
Retired VBF Adm1nistrator
Have you told it to use FTP as the protocol ?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 22nd, 2002, 10:06 AM
#3
Thread Starter
Fanatic Member
Protocol?
I added the Inet1 object to my form and I have the code that I posted before.
How else would I tell it to use FTP as the Protocol?
Thanks
-
Aug 22nd, 2002, 10:10 AM
#4
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 22nd, 2002, 10:19 AM
#5
Thread Starter
Fanatic Member
Still won't copy the file
I put that in there, but it still won't work.
It doesn't run forever now, it just doesn't copy the program file over. I can get it to work using a batch file, but not using this control.
With Inet1
.RemoteHost = "10.10.10.10"
.RemotePort = "21"
.UserName = "Administrator"
.Password = "******"
Inet1.Protocol = icFTP
.Execute , "Put GallonageRpt.Exe C:\Progra~1\Gallon~1"
End With
Do Until Inet1.StillExecuting = False
DoEvents
Sleep 1000
Loop
-
Aug 22nd, 2002, 10:55 AM
#6
Addicted Member
I think the problem lies in your .execute command. I have an ftp server set up at 10.0.0.88, with one virtual directory, which is called "test". So I can get to that directory, in say, internet explorer, by going to ftp://10.0.0.88/test.
I can upload a file from the root of my c drive into the test folder on my ftp server with the following syntax
VB Code:
.Execute , "Put C:\blah.txt test\blah.txt"
I think your problem is that the destination in your command is actually a local path, eg "C:\Progra~1\Gallon~1". Ftp servers simply don't reference paths like that.
Try it with a small text file from the root of your c drive, to a folder you know exists on your ftp server, that you can get to by going to "ftp://10.10.10.10/your_folder_name" in IE.
MCSE, Mcp+I, Unicenter Engineer
-
Aug 22nd, 2002, 11:04 AM
#7
Thread Starter
Fanatic Member
I don't need to copy a file from my local computer to the FTP server. I need to get a file from the FTP server and copy it to my local hard drive.
I can't even do this for some reason...
.Execute, "lcd C:\Progra~1\Gallon~1"
After I run the above command, it says it is still executing no matter how long I wait.
After that is ran, I would like to be able to run the following and have it copy the program file from my FTP server to my local hard drive.
.Execute , "Get GallonageRpt.Exe"
Like I said before, I can do all this in a batch file, but I would like to be able to do it inside VB.
-
Aug 22nd, 2002, 11:05 AM
#8
Retired VBF Adm1nistrator
Um. You could use a packet sniffer (eg, ethereal) and see what the ftp server sends back.
Also, try doing those exact steps in dos ftp
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 22nd, 2002, 11:14 AM
#9
Addicted Member
No offence, but the vb code you originally posted prior to my reply is for uploading files TO an ftp server. I therefore assumed that's what you're trying to do. If not, the exact same principles hold true, try using
VB Code:
.Execute , "Get test\blah.txt C:\blah.txt"
But make sure you're actually accessing a virtual directory and a file that exists. You can verify this by trying to get to it in IE.
Please, if you're posting code, post the code you're actually trying to use, rather than something else which is "near enough" an example of what you're trying to do. It makes troubleshooting the problem a lot easier.
(And of course, having said that, I got the syntax for my execute command wrong. Sheesh. Try the one i've now editted in this post)
Last edited by chicocouk; Aug 22nd, 2002 at 11:27 AM.
MCSE, Mcp+I, Unicenter Engineer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|