I have a printer driver from www.flex-systems.com in the form of a setup.exe. It is required to run this setup to install the printer driver and their instructions explictly state that "Trying to install the printer drivers in any other way will result in an erroneous installation" unless you run their setup.exe. You are also required to input a serial/product number in order to run the install. I'm thinking the best way to manage this is to just run a vb script since silent installation is not required but prepopulating the serial key in the input field is. I have a script to launch the program and click the next button and this is where it breaks down. The next screen has the serial field but it is not activated with the cursor so I can't send key strokes to it and I don't know how to make it active without manually clicking in it.

Here is what I have so far:

Set WshShell = WScript.CreateObject("WScript.Shell")

' run setup
WshShell.Run "setup.exe"

' wait for program to load
WScript.Sleep 500

' send the 'enter' key to advance to second screen
WshShell.SendKeys "{ENTER}"

Need command here to activate product key field

' send Serial Number keys
WshShell.SendKeys "########"

0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


Ignore their bleatings about erroneous installation: there's nothing they're doing in that EXE that can't be done via an MSI with Custom Actions, WiseScript or whatever.

Having said that, if you *really* want a bodged job, how about WSShell.SendKeys {TAB} the requisite number of times to tab to the relevant text-box?
Answered 02/05/2008 by: VBScab
Red Belt

Please log in to comment
If you want to automate the interactive installation like this, VBScript can be pretty limiting. AutoIt is a free scripting language created just for this task. They even provide it as a COM component (AutoItX.dll) so that you can make use of its functionality from VBScript if you wish. In your scenario you could use it to:

- Run the setup
- Look for the initial screen by title (rather than guessing how long to wait)
- Actually initiate a click event on the "Next" button (instead of enter, which if someone is sitting at the comptuer may be incorrect)
- Provide the product key to the product key field of the form directly (no tabbing to find it)

It is fairly easy to use and well documented. Have a look:
Answered 02/05/2008 by: bkelly
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity