|
|
 |
| Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning VB 6 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 25th, 2009, 12:48 PM
|
|
Authorized User
|
|
Join Date: Jul 2006
Location: Batavia, IL, USA.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

June 25th, 2009, 11:45 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
As long as you have a handle to the process (CreateProcess, ShellExecute, etc.) you can use the WaitForSingleObject to wait upon the process.
Good Luck
|

June 26th, 2009, 05:33 PM
|
|
Authorized User
|
|
Join Date: Jul 2006
Location: Batavia, IL, USA.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by vb5prgrmr
As long as you have a handle to the process (CreateProcess, ShellExecute, etc.) you can use the WaitForSingleObject to wait upon the process.
Good Luck
|
I didn't think you could do this with shellexecute because it doesn't return a handle to the process.
|

June 27th, 2009, 11:31 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Opps... Sorry... followed by FindWindow. Forgot that when looked at example and wrote reply.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |