Sign in to follow this  
Followers 0
YoungRacoon

Working with ControlTreeView

7 posts in this topic

Hi! Can anyone help me with ControlTreeView?

All I want is to position on "System Tools -> Local Users and Groups" in compmgmt.msc (Computer Management).

Here is my code:

run ("cmd /c compmgmt.msc", @SystemDir, @SW_HIDE)
WinWaitActive("Computer Management")
ControlTreeView ("Computer Management", "Computer Management (Local)", 12785, "Select", "Heading2|H1SubItem1")

Computer Management snapin opens successfully but after that nothing happens. The upper node Computer Management (Local) remains selected. What's wrong with my code? How to select "System Tools -> Local Users and Groups"?

Thanks in advance,

Yuri.

post-32239-1203345954_thumb.jpg

Share this post


Link to post
Share on other sites



ControlTreeView ("Computer Management", "", 12785, "Select", ""Computer Management (Local)|System Tools|Local Users and Groups"")
Thank you, Zedna. Actually, it's not working. Any suggestions?

---------------------------

AutoIt Error

---------------------------

Line 5 (File "compmgmt.au3"):

ControlTreeView ("Computer Management", "", 12785, "Select", ""Computer Management (Local)|System Tools|Local Users and Groups"")

ControlTreeView ("Computer Management", "", 12785, "Select", ""Computer Management (Local)^ ERROR

Error: Unable to parse line.

---------------------------

OK

---------------------------

Share this post


Link to post
Share on other sites

ControlTreeView ("Computer Management", "", 12785, "Select", ""Computer Management (Local)|System Tools|Local Users and Groups"")
Yes, I got it. The final variant is

ControlTreeView ("Computer Management", "", 12785, "Select", "Computer Management (Local)|System Tools|Local Users and Groups")

There were accidental quotes in your example. But you pushed me in the right direction.

Thank you very much, Zedna! I really appreciated your help!

Share this post


Link to post
Share on other sites

hi can somebody help me out i allmust want teh same but now not the local users and groups but the device manager and then expend the network divices can somebody help me with this,,

Run(@ComSpec & " /c " & 'devmgmt.msc', "", @SW_HIDE)

winwait("Apparaatbeheer")

ControlTreeView("Apparaatbeheer", "", "", "Expand", "Netwerkadapters")

If @error = 1 Then MsgBox(1, "", "Error")

Share this post


Link to post
Share on other sites

hi can somebody help me out i allmust want teh same but now not the local users and groups but the device manager and then expend the network divices can somebody help me with this,,

You have another Topic on this, read my awnser in there...

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

can somebody tell me why this dont work this code fits the devicemanager and then its selecting the networking devices but with the 2th controltreeview command it should select the first network device that below netwerkadapters.. but the problem is that dont work....

#RequireAdmin

Run(@ComSpec & " /c " & 'devmgmt.msc', "", @SW_HIDE)

winwait("Apparaatbeheer")

Sleep(1500)

ControlTreeView("Apparaatbeheer", "", "[Class:SysTreeView32; Instance:1]", "Expand", @ComputerName & "|Netwerkadapters")

Sleep(500)

ControlTreeView("Apparaatbeheer", "", "[Class:SysTreeView32; Instance:1]", "Select", @ComputerName & "|Netwerkadapters|#1")

Send("{ENTER}")

Edited by yucatan

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  
Followers 0