943,840 Members | Top Members by Rank

Ad:
Jul 21st, 2009
0

Existing Shell in VB6

Expand Post »
Hi,

Does anyone know how to send commands to a shell that is already opened?

I know how to open the shell to run a command, but how do I send another command to it?

Here is what I can do

Shell("C:\Backup\mysqlbackup.bat")

This command runs the mysqldump command. But the mysqldump command needs a password to execute.

How would I go about automatically sending the password to it?

Thanks in advance
Sam
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
samuelmoneill is offline Offline
11 posts
since Jul 2009
Jul 21st, 2009
0

Re: Existing Shell in VB6

Use findwindow to get the handle of the window and then use SendMessage with WM_SETTEXT const. (You can't supply this info in the bat file?)


Good Luck
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Jul 21st, 2009
0

Re: Existing Shell in VB6

Give up shell, you have to start new process by API call, get stdin and stdout handle and you can send/read there commands directly. It can look difficult but it is piece of cake - all what you need is several api calls.
Reputation Points: 10
Solved Threads: 9
Junior Poster
VIeditorlover is offline Offline
137 posts
since Dec 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: How much would you pay
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Autonumber from access field.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC