Jump to content

grwork1

Members
  • Posts

    3
  • Joined

  • Last visited

grwork1's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. 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.
  2. Thanks for replies so far. Re. IDE. I am not using one but running a VB script via cscript at a Win 7 Admin Command Prompt. Re. Admin permissions. I'm not convinced that this is my problem as I can ControlClick on other controls in the MMC IIS dialog. In short, could somebody with AutoItX knowledge Run the MMC IIS Manager and try to activate the 'View Sites' control in the right-hand pane because I sure as hell can't. New simplified VB test script attached.
  3. I am failing to control MMC Internet Information Services (IIS) Manager dialog. Searching the forum; the answer would seem to be to add #RequireAdmin. Problem is #RequireAdmin is not defined in AutoItX help and gives syntax error in VB script. How do I achieve the #RequireAdmin fuctionality in a VB script using AutoItX. My script, preceded by some notes, is attached. Grateful for any help.[update: Calling IsAdmin reveals that true so perhaps this is not a permissions issue but a basic error on my part in using ControlClick?
×
×
  • Create New...