mikef17
asked on
Is it possible?
I want run self extracting file from VB.
That file will be run in DOS window.
And ask me enter Yes(Y) or No(N),and
Enter after that.How can i do it in VB
insted of user (i want that user will not press any key).
Thanks in advance!
That file will be run in DOS window.
And ask me enter Yes(Y) or No(N),and
Enter after that.How can i do it in VB
insted of user (i want that user will not press any key).
Thanks in advance!
ASKER
Hi,TimCottee!
Thanks for response.
This code not work properly.
Sendkeys function not works.
What possible problem???
Thanks for response.
This code not work properly.
Sendkeys function not works.
What possible problem???
I think that the code from TimCottee is right, but the SendKey is probably sent too soon. In fact, as soon as the dos shell is launched (with de self-extract file running), the vb code continue and then the 'Y' + 'ENTER' keys are sent, even before the question (Y / N ?) is asked. Find a way to send the key later.
An other solution would be using ShellExecute and pass a parameter to the self-extractingExe (ex.: /Y). Try it.
An other solution would be using ShellExecute and pass a parameter to the self-extractingExe (ex.: /Y). Try it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,samopal!
What exactly i need type in text file
(i can't enter bytes?!)
What exactly i need type in text file
(i can't enter bytes?!)
Ok. Open Notepad, press <Y> and <Enter>. Save this file as "Yes.txt" The length of this file should be 3 bytes, and no bit more! :-))
ASKER
Hi,samopal!
That's not work.May be self extracting file need some waiting time?
That's not work.May be self extracting file need some waiting time?
Private Sub Command2_Click()
Dim dblProcID As Double
dblProcID = Shell("SelfExtractingEXE.E
AppActivate (dblProcID)
SendKeys "Y{ENTER}"
End Sub