Jump to content

tabs


Recommended Posts

You can do this to directly open the properties of a specific device:

Run("Rundll32.exe devmgr.dll DeviceProperties_RunDLL /DeviceID PCI\VEN_8086&DEV_10BD&SUBSYS_2818103C&REV_02\3&B1BFB68&0&C8")

The device id is probably different on every machine. What is the setting you are trying to change?

Link to comment
Share on other sites

i need to make a script that set this checkbox off and the script needs to read hoemany network devices there are and he needs to do it on all network devices and the script needs to be universul zo work on all computers not only @ my own

this is the code of the script i have now

#include <GuiTreeView.au3>

Opt("WinTitleMatchMode", 4)

ShellExecute("devmgmt.msc")

WinWait("[CLASS:MMCMainFrame; TITLE:Apparaatbeheer]")

$hWin = WinGetHandle("[CLASS:MMCMainFrame; TITLE:Apparaatbeheer]")

WinActivate($hWin)

WinWaitActive($hWin)

$hSTV = ControlGetHandle($hWin, "", "SysTreeView321")

$iCount = _GUICtrlTreeView_GetCount($hSTV)

ConsoleWrite("Debug: STV Total Items $iCount = " & $iCount & @LF)

$hSTV_Item = _GUICtrlTreeView_GetFirstItem($hSTV)

$sItemText = _GUICtrlTreeView_GetText($hSTV, $hSTV_Item)

ConsoleWrite("Debug: Top item $sItemText = " & $sItemText & @LF)

$hChildNetwork = _GUICtrlTreeView_FindItem($hSTV, "Netwerkadapters", True, $hSTV_Item)

If $hChildNetwork = 0 Then

MsgBox(16, "Error", "Failed to find Network adapters child handle.")

Exit

EndIf

ConsoleWrite("Debug: Found Netwerkadapters Handle Item = " & $hChildNetwork & @LF)

_GUICtrlTreeView_Expand($hSTV, $hChildNetwork, True)

$iNetworkChildCount = _GUICtrlTreeView_GetChildCount($hSTV, $hChildNetwork)

ConsoleWrite("Debug: Item Child $iChildCount = " & $iNetworkChildCount & @LF)

$iFirstNetworkChild = _GUICtrlTreeView_GetFirstChild ($hSTV, $hChildNetwork)

ConsoleWrite("Debug: Found First Network child item = " & $hChildNetwork & @LF)

$iNextNetworkChild = _GUICtrlTreeView_GetNextSibling ($hSTV,$hChildNetwork)

ConsoleWrite("Debug: Found Next Network child item = " & $hChildNetwork & @LF)

_GUICtrlTreeView_SelectItem($hSTV, $iFirstNetworkChild, True)

ConsoleWrite("Debug: Current selection: " & _GUICtrlTreeView_GetSelection($hSTV) & @LF)

ConsoleWrite("Debug: Note item is current selection, but does not appear to be selected on the GUI." & @LF)

Sleep(500)

_GUICtrlTreeView_ClickItem($hSTV, $iFirstNetworkChild)

ConsoleWrite("Debug: NOW it should be selected, and the onclick event should have enabled the properties icons." & @LF)

Send("{ENTER}")

Sleep(5000)

_GUICtrlTreeView_SelectItem($hSTV, $iNextNetworkChild, True)

ConsoleWrite("Debug: Current selection: " & _GUICtrlTreeView_GetSelection($hSTV) & @LF)

ConsoleWrite("Debug: Note item is current selection, but does not appear to be selected on the GUI." & @LF)

Sleep(500)

_GUICtrlTreeView_ClickItem($hSTV, $iNextNetworkChild)

ConsoleWrite("Debug: NOW it should be selected, and the onclick event should have enabled the properties icons." & @LF)

Send("{ENTER}")

post-33750-1208355453_thumb.jpg

Link to comment
Share on other sites

i wanne set a checkbox off in that windows i already tryed the register but its in a $ so on eatch computer its different

The same method will work. Just Run() the proper *.cpl file with a space then a comma and the tab number (0 indexed).

Example Run("inetcpl.cpl ,2")

Or

ShellExecute("inetcpl.cpl", ",2")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

This should work better. Found here http://support.microsoft.com/kb/837058:

$key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"

$i = 1
While 1
    ;Read subkeys until error occurs
    $var = RegEnumKey($key, $i)
    If @error <> 0 then ExitLoop
    
    ;Get description
    $name = RegRead($key & "\" & $var, "DriverDesc")
    
    ;Get current power setting
    $pnp = RegRead($key & "\" & $var, "PnPCapabilities")
    
    ;If an entry exists for the power mode, overwrite it
    If $pnp <> "" Then
        ConsoleWrite("Device name: " & $name & " Current PnP mode: " & $pnp & @CRLF)
        RegWrite($key & "\" & $var, "PnPCapabilities", "REG_DWORD", 38)
    EndIf
    
    $i += 1
WEnd
Link to comment
Share on other sites

This should work better. Found here http://support.microsoft.com/kb/837058:

$key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"

$i = 1
While 1
    ;Read subkeys until error occurs
    $var = RegEnumKey($key, $i)
    If @error <> 0 then ExitLoop
    
    ;Get description
    $name = RegRead($key & "\" & $var, "DriverDesc")
    
    ;Get current power setting
    $pnp = RegRead($key & "\" & $var, "PnPCapabilities")
    
    ;If an entry exists for the power mode, overwrite it
    If $pnp <> "" Then
        ConsoleWrite("Device name: " & $name & " Current PnP mode: " & $pnp & @CRLF)
        RegWrite($key & "\" & $var, "PnPCapabilities", "REG_DWORD", 38)
    EndIf
    
    $i += 1
WEnd

ok now 2 things when this is dont he needs to get to the secend network adapter and olso do it

then go to the third and do it again this needs to be a loop so when i have 9 card it needs to work and when i have one it needs to work to so a loopt that he stays checking for the next and loop until he is on the last card... but does this code already set the checkbox off(after the reboot ofcourse) ?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...