p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 25th, 2009, 12:48 PM
Authorized User
Points: 108, Level: 2
Points: 108, Level: 2 Points: 108, Level: 2 Points: 108, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: Batavia, IL, USA.
Posts: 27
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 25th, 2009, 11:45 PM
Authorized User
Points: 135, Level: 2
Points: 135, Level: 2 Points: 135, Level: 2 Points: 135, Level: 2
Activity: 37%
Activity: 37% Activity: 37% Activity: 37%
 
Join Date: Mar 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old June 26th, 2009, 05:33 PM
Authorized User
Points: 108, Level: 2
Points: 108, Level: 2 Points: 108, Level: 2 Points: 108, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: Batavia, IL, USA.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by vb5prgrmr View Post
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old June 27th, 2009, 11:31 PM
Authorized User
Points: 135, Level: 2
Points: 135, Level: 2 Points: 135, Level: 2 Points: 135, Level: 2
Activity: 37%
Activity: 37% Activity: 37% Activity: 37%
 
Join Date: Mar 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Opps... Sorry... followed by FindWindow. Forgot that when looked at example and wrote reply.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do API Declarations Incr. .EXE size? BrianWren Pro VB 6 6 December 21st, 2007 03:23 PM
API for Secure FTP (SFTP/SSH) redbudval Pro VB.NET 2002/2003 2 December 7th, 2007 06:27 PM
Membership: aspnet_sql.exe -> aspnet_regsql.exe ricpue BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 August 10th, 2006 12:40 AM
problem creating .exe from MFC AppWizard(exe) c++ method Visual C++ 0 July 7th, 2006 04:28 AM
running an .exe API without installing a service taunon C# 0 June 10th, 2006 10:37 AM



All times are GMT -4. The time now is 03:47 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc