Existing Shell in VB6

Reply

Join Date: Jul 2009
Posts: 11
Reputation: samuelmoneill is an unknown quantity at this point 
Solved Threads: 0
samuelmoneill samuelmoneill is offline Offline
Newbie Poster

Existing Shell in VB6

 
0
  #1
Jul 21st, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 809
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: Existing Shell in VB6

 
0
  #2
Jul 21st, 2009
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
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 97
Reputation: VIeditorlover is an unknown quantity at this point 
Solved Threads: 5
VIeditorlover's Avatar
VIeditorlover VIeditorlover is offline Offline
Junior Poster in Training

Re: Existing Shell in VB6

 
0
  #3
Jul 21st, 2009
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC