Jump to content
Sign in to follow this  

duplicate "right click/repair wireless" process

Recommended Posts


Hey all. I have a very very locked down set of XP Pro machines with a very limited desktop and I need to give the logged in user the ability to run something that essentially does the same things as right clicking on a wireless connection and selecting repair. Can anyone help? I have seen some nice wireless scripting that pulls wireless info, but my search didnt yeild much on running a repair.

Thanks in advance...it never ceases to amaze me that AutoIT is still free and this forum is brilliant.

Share this post

Link to post
Share on other sites

You can use windows shellobject with .verbs and .doit to repair, disable, enable ..etc the connection.

This crude example will hopefully be enough for you to work it out and build it the way you see fit.

(the example has no proper error checks and as stated it's in it's crudest form)

_RepairConnection("Wireless Network Connection")

; $sName = the name of the adapter as shows in the Network Connections folder under Name.
Func _RepairConnection($sName)
    Local Const $NETWORK_CONNECTIONS = 0x31
    Local $objShell, $objFolder
    $objShell = ObjCreate("Shell.Application")
    If Not IsObj($objShell) Then Return SetError(1, 0, 0)
    $objFolder = $objShell.NameSpace($NETWORK_CONNECTIONS) 
    If Not IsObj($objFolder) Then Return SetError(2, 0, 0)
    For $objItem in $objFolder.Items
        If $objItem.Name = $sName Then
            For $oVerb In $objItem.Verbs
                If $oVerb.Name = "Re&pair" Then $oVerb.DoIt

Edit: This requires Win 2000 or higher. (XP is fine, Vista I have no idea)


Edited by smashly

Share this post

Link to post
Share on other sites

Thanks! Actually thats exactly the kind of thing I was looking for.


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
Sign in to follow this