MarcZ Posted June 9, 2014 Share Posted June 9, 2014 (edited) Good day. I've been having some difficulties getting going with AutoItX. What I am trying to do is to use AutoItX within PowerShell to automate some difficult GUI interactions in an application I have. I am not trying to execute AU scripts but rather wish to programmatically call AutoItX function call inside a powershell script. So far all documentation I have found shows the exact same: 1. Register the correct AutoItX DLL (by arch) 2. Create a "New-Object" and 3. Call the method needed. And so far all the code samples I have found look the same,(e.g:This should simply launch an instance of notepad.) <code> $AutoIt = New-Object -ComObject AutoItX3.Control$result = $AutoIt.Run("notepad.exe") </code> The problem is that this ".Control" is not available (though a "Control.Tasksymbol" is seen" So my questions are: 1. How can I determine that the DLL is indeed registered in Windows? 2. What is the correct way to "make available" to powershell, the contained methods of AutoItX ? 3. Should/ should not ".Control" show up in the intellisense/autocomplete? Thanks! M. Edited June 9, 2014 by MarcZ Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 10, 2014 Share Posted June 10, 2014 You should actually just use Jon's Powershell extension which is in your install of AutoIt at "C:\Program Files\AutoIt3\AutoItX\AutoItX3.PowerShell.dll" or the x86 program files if you have a 64 bit Windows. Link to comment Share on other sites More sharing options...
ptrex Posted August 22, 2014 Share Posted August 22, 2014 @MArcZ A bit late but this will get you going. http://audministrator.wordpress.com/2014/08/09/error-getting-autoitx3-dll/ Rgds ptrex 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...
Administrators Jon Posted August 23, 2014 Administrators Share Posted August 23, 2014 Yes, use the PowerShell interface, not the COM one - this handles all the x86/x64 problems automagically. Just open PS, browse to the AutoItX folder and then do: # Import the module manfiest Import-Module .AutoItX3.psd1 # Get the list of AutoItX cmdlets Get-Command *AU3* # Get detailed help for a particular cmdlet Get-Help Get-AU3WinText Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
ptrex Posted August 24, 2014 Share Posted August 24, 2014 (edited) @MarkZ Quick PS Example CLS # Import the module manfiest Import-Module (${Env:ProgramFiles(x86)} + "\AutoIt3\Beta\AutoItX\AutoItX3.psd1") I nvoke-AU3Run("Notepad") Wait-AU3WinActive("Untitled") Send-AU3Key("I'm in notepad"); $winHandle = Get-AU3WinHandle("Untitled"); Sleep -Seconds 2 Close-AU3Win($winHandle) # Get the list of AutoItX cmdlets Get-Command *AU3* # Get detailed help for a particular cmdlet # Get-Help Get-AU3WinText Rgds ptrex Edited August 24, 2014 by ptrex 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...
Administrators Jon Posted August 24, 2014 Administrators Share Posted August 24, 2014 For info as well, in the current betas i'm registering the path in PSModulePath so import should work without having to specify the path Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
ptrex Posted August 24, 2014 Share Posted August 24, 2014 @Jon, Good to know But it did not work on my side ? "Import-Module : The specified module 'AutoItX3.psd1' was not loaded because no valid module file was found in any module directory." But doesn't harm to puth in the path as it seems. 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...
Administrators Jon Posted August 24, 2014 Administrators Share Posted August 24, 2014 It's renamed to AutoItX.psd1 in the beta. (For the auto import to work the psd file must be named the same as the parent folder which is "autoitx") Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
ptrex Posted August 24, 2014 Share Posted August 24, 2014 OK great thanks ! ptrex 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