![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 52
Rep Power: 3
![]() |
enter key
Hey everyone i'm trying to write an automated install batch file for spybot, so far i have it installing the program updating running and autofixing problems. The issue though is that internet needs to be connected and this isn't the case where i want to use it (work). The three updates though are .exe files but they have no parameters built in. I can use my batch file to launch the update manually but it prompts the user where to install it (all you have to do is hit enter). How do i simulate the pressing of an enter key in my batch file so i don't have any user interaction...thanks
|
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4
![]() |
As far as I know you can't do this with a batch file, but you can do it with VBScript or JScript running in WSH (the WIndows Scripting Host). I'm a little pressed for time right now but some snippets that might help are:
Dim objSH
Set objSH = WScript.CreateObject("WScript.Shell")
objSH.SendKeys("{ENTER}")You need to activate the installer first; that's done with another method of WScript.Shell called ActivateApp or ActivateWindow or something along those lines; you'll find it in any tutorial or documentation on SendKeys since the two go hand in hand. I know it may seem awkward to learn VBScript or JScript if you don't already know it, but I don't think a batch file is going to solve your problem and either of these is quick enough to pick up. If you've got any JavaScript experience or experience with a C-like language you'll get up and running with JScript pretty quickly. Just do some searches for introductory material on WSH and SendKeys. That should get you going. Hope this helps.
__________________
"I'm not a genius. Why do I have to suffer?" |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Slackware installation guide for Linux beginners | coldDeath | Coder's Corner Lounge | 104 | Jul 29th, 2007 4:40 AM |
| please help me to compile | cwl157 | C++ | 37 | Mar 6th, 2006 6:12 PM |
| replace space with ' * ' | TecBrain | C++ | 15 | Apr 13th, 2005 12:32 PM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 4:12 PM |
| Whats wrong... | brandcolt | C++ | 6 | Mar 1st, 2005 10:37 AM |