Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie so bare with me, any command to say Yes or Enter for pop up 1

Status
Not open for further replies.

33788

IS-IT--Management
Mar 15, 2005
97
US
I have a program I'm pushing out remotely. During the push and installation a message pops up to accept a License Agreement. I'd like a command to just auto click Yes or Enter so the installation will complete. Is their a command weather it be a DOS command or VBScript. My push software can use DOS batch or VBScript. I'm new at this so please bare with me on my terminology. Thanks ahead.
 
You should really see if there is a command line switch you can use to accept the agreement. VBScript can send a key command, but I personally do not trust it because it is not reliable by any means.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
You will want to know the name of the process running so you can first activate the window in case it does not have the focus. then you can use SendKeys to send the Enter button keystroke. Replace the text in [red]red[/red] with the applicable process name.

Code:
Set WshShell = CreateObject("WScript.Shell")
'Setting focus to the window you want
WshShell.AppActivate "[red]ProcessName[/red]"
'wait for it......
wscript.sleep 200
WshShell.SendKeys "{ENTER}"

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thank you all. The information you provided has been very helpful. I'm realizing that if I send a Y (yes) key first then the Enter key would work best. How can I get the system to shoot the Y first then Enter. The codes you provided markdmac was very helpful. It allowed me to get a better understanding of this whole situation. Let me know if it's possible to send a "Y" first then "Enter". Thanks ahead.
 
does the program not support a silent install
e.g setup.exe /quiet or setup.exe /q or setup.exe /silent

or does it have a MSI file?
 
GrimR it actually does but I have to START an additional file which is a license file. So I have to click Yes then OK. This is where I'm getting sumped.
 
WshShell.SendKeys "y"
WshShell.SendKeys "{ENTER}"

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Very cool, Mark. Thanks.


"We must fall back upon the old axiom that when all other contingencies fail, whatever remains, however improbable, must be the truth." - Sherlock Holmes

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top