Thread: API FTP.exe
View Single Post
  #1 (permalink)  
Old June 25th, 2009, 12:48 PM
DanRoche DanRoche is offline
Authorized User
Points: 119, Level: 2
Points: 119, Level: 2 Points: 119, Level: 2 Points: 119, Level: 2
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Jul 2006
Location: Batavia, IL, USA.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default API FTP.exe

Greetings, I wasn't sure where to put this since I didn't see an api forum.

I'm not implementing this particular code in VB, but it's all api, so it shouldn't matter, should it?

I want to use FTP.exe through createprocess api so that I can implement waitforsingleobject.

Here is my command:

Code:
createprocess("c:\winnt\system32\cmd.exe","c:\winnt\system32\cmd.exe /C c:\winnt\system32\ftp.exe -i -s:ftpscript.txt > c:\temp\ftp.out"), 0,0,0,0,0, sys(5)+sys(2003),@lcStartupInfo, @lcProcInfo)
I'm using cmd.exe cause I want to pipe output. The ftp.out file has the following in it:
ftpscript.txt contains:
open IPAddress
username
password
binary
put bob.xls
bye

ftp.out contains:
ftp> ftp>
ftp> open IPAddress
Invalid command.
ftp> Username
Invalid command.
ftp> password
Not connected.
ftp> binary
Not connected.
ftp> put bob.xls
bye

This works without createprocess, but then I can't use WaitForSingleObject, right?

Thanks
Reply With Quote