Jump to content
Sign in to follow this  

AutoItX: ControlTreeView in the beta

Recommended Posts


Hi. Jon was so kind to implement ControlTreeView in the AutoItX beta (http://svn.autoitscript.com/trac/ticket/244). I tried to make it work but bumped into the following:

It works (AutoIt):

run ('cmd /c "compmgmt.msc"', "c:\windows\system32\")
WinWaitActive("Computer Management")
ControlTreeView ("Computer Management", "", 12785, "Select", "Computer Management (Local)|System Tools")

It doesn't work (jscript & AutoItX):

var oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.Run('cmd /c "compmgmt.msc"', "c:\\windows\\system32\\")
oAutoIt.WinWaitActive("Computer Management")
oAutoIt.ControlTreeView ("Computer Management", "", 12785, "Select", "Computer Management (Local)|System Tools")

Computer Management mmc is opened successfully but while trying to select an item I get the following error:


Windows Script Host


Script: E:\Expo\test.js

Line: 4

Char: 1

Error: Wrong number of arguments or invalid property assignment

Code: 800A01C2

Source: Microsoft JScript runtime error

Could you please tell me what's wrong with this piece of code? What should I take into account?

Thanks in advance, Yuri.

Edited by YoungRacoon

Share this post

Link to post
Share on other sites

add a blank parameter on the end:

oAutoIt.ControlTreeView ("Computer Management", "", 12785, "Select", "Computer Management (Local)|System Tools", "")

Jon, it works! Thanks!

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.