grwork1 Posted November 8, 2012 Share Posted November 8, 2012 Hi, Using AutoItX3, does anyone know how I can access/ControlClick the "View Sites" control in the right-hand pane of the Windows Microsoft Management Console (MMC) Internet Information Servcies (IIS) dialog. I have no trouble ControlClick'ing other controls in the centre pane, e.g. "Filter" edit box and "Group by" drop down list. PC is running Windows 7, 64-bit. The following script is lauched using the following command in an Admin Command Prompt: > C:\windows\syswow64\cscript <vbscriptName>.vbs with AutoItX3.dll located in C:\windows\syswow64. ---------- The VB script: Option Explicit Dim oShell Dim oAutoIt Dim IISWIn Dim result Set oShell = WScript.CreateObject("WScript.Shell") Dim intError intError = oShell.Run("regsvr32 /s C:\WINDOWS\system32\AutoItX3.dll",,True) Wscript.Sleep 3000 Set oAutoIt = WScript.CreateObject("AutoItX3.Control") if oAutoIt.IsAdmin then WScript.Echo "Admin rights detected." 'Run an Internet Information Services Window oShell.Run "%SystemRoot%\system32\inetsrv\iis.msc" IISWIn = "iis - [internet Information Services (IIS) Manager]" ' Wait for the program window to appear and make it active oAutoIt.WinWait IISWIn oAutoIt.WinActivate IISWIn if (oAutoIt.WinActive(IISWIn)) then WScript.Echo "IISWIn Windowactive" end if result = oAutoIt.ControlClick(IISWIn, "", "Edit1") ' Class Text: Works! Cursor appears in "Filter" edit box. [OK] result = oAutoIt.ControlSend(IISWIn, "", "Edit1", "ftp") ' [OK] oAutoIt.Sleep 2000 result = oAutoIt.ControlClick(IISWIn, "", "WindowsForms10.COMBOBOX.app.0.21d16742") ' ClassnameNN: Works! "Group by" drop down list appears. [OK] oAutoIt.Sleep 2000 result = oAutoIt.ControlClick(IISWIn, "", "View Sites") ' Class Text: "View Sites" is not left clicked!! [FAIL] if (result <> 1) then oShell.Popup("Error ControlClick") ' Never triggered. wscript.quit end if 'Try again after forcing focus to right-hand pane. result = oAutoIt.ControlFocus(IISWIn, "", "WindowsForms10.window.8.app.0.21d167414") ' ClassnameNN: if (result <> 1) then oShell.Popup("Error ControlFocus") wscript.quit end if oAutoIt.Sleep 2000 result = oAutoIt.ControlClick(IISWIn, "", "View Sites") ' [FAIL] oAutoIt.Sleep 2000 ' Try again using ClassName instead of Class Text and trying 2 left clicks. result = oAutoIt.ControlClick(IISWIn, "", "WindowsForms10.STATIC.app.0.21d167411", "left", 2) ' [FAIL] oAutoIt.Sleep 2000 WScript.Quit P.S. IIS has to be enabled via 'Start\Control Panel\Programs and Features\Turn Windows Features on or off' for the iis.msc to exist. Thanks in advance for anyone who tries this. Link to comment Share on other sites More sharing options...
ptrex Posted November 8, 2012 Share Posted November 8, 2012 Maybe this can get you started ?MMC is a COM object is selfhttp://msdn.microsoft.com/en-us/library/windows/desktop/aa815371(v=vs.85).aspxRgdsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now