Jump to content
caidos

Add Hardware Wizard

Recommended Posts

caidos

I am trying to automate the install of the Microsoft loopback adapter. I am running the Add new hardware wizard and I get stuck trying to advance the wizard. Even when I manually click on the Next button it just loads the same screen and doesn't advance the wizard. Any thoughts or ideas? I have tried not selecting things from the list view, mouse clicks and trying to figure out what makes this screen unique. Here is the code I have:
 

#include <GUIConstants.au3>
#include <GuiListView.au3>
#RequireAdmin
Run("hdwwiz.exe")
Local $commonTitle = "Add Hardware"
WinWaitActive($commonTitle, "This wizard helps you install driver software to support older devices")
; Click Next
Send("!n")
WinWaitActive($commonTitle, "The wizard can search for other hardware and automatically install it for you")
; Install the hardware that I m_anually select from list (Advanced)
Send("!m")
; Next
Send("!n")
WinWaitActive($commonTitle, "If you do not see the hardware category you want, click Show All Devices")
$handleListView = ControlGetHandle($commonTitle, "", "[CLASS:SysListView32; INSTANCE:1]")
$networkAdapterListBoxIndex = _GUICtrlListView_FindText($handleListView, "Network adapters")
_GUICtrlListView_SetItemSelected($handleListView, $networkAdapterListBoxIndex);
; Click Next
Send("!n")

 

Share this post


Link to post
Share on other sites
Deye
Posted (edited)

if you start up device manager like so (add legacy hardware) it should reveal the options

Run("mmc devmgmt.msc")
WinWaitActive("Device Manager")
$hTree = ControlGetHandle("Device Manager", "", "[Class:SysTreeView32;Instance:1]")
ControlFocus("Device Manager", "", $hTree)
ControlSend("Device Manager", "", $hTree, "{APPSKEY}")
ControlSend("Device Manager", "", $hTree, "{down}")
ControlSend("Device Manager", "", $hTree, "{down}")
ControlSend("Device Manager", "", $hTree, "{ENTER}")

 

Edited by Deye

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×