Jump to content

Having an issue with Windows XP 64 Bit and AutoIT


Recommended Posts

Greetings,

First time poster looking for some help.

When I run the following script via a Windows XP 64 Bit computer, I get the error message posted below

CODE
' Require Variants to be declared before used

Option Explicit

Dim oShell

Dim oAutoIt

Set oShell = WScript.CreateObject("WScript.Shell")

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

WScript.Echo oAutoIt.Run("notepad.exe", "")

oAutoIt.WinWaitActive("Untitled")

oAutoIt.ControlSend "Untitled -", "", "Edit1", "This is a line 1 of text{ENTER}"

oAutoIt.ControlSend "Untitled -", "", "Edit1", "This is a line 2 of text{ENTER}"

Error Message

Script: TEST.vbs

Line: 8

Char: 1

Error: Could not create object named "AutoITX3.Control".

Code: 80040154

Source: WScript.CreateObject

This script works perfectly fine on our XP 32 Bit Computers

I've seen that it may be a DLL issue. I successfully registered the DLL by copying the dll manually to the C drive and running:

C:\WINDOWS\SYSWOW64\regsvr32 C:\WINDOWS\SYSWOW64\autoitx3.dll

I copied the DLL because I wish to not fully install the application since this is a 1 time needed script.

Any help you can provide would be greatly appreciated

Link to comment
Share on other sites

Running under Windows 64-bit Edition

AutoIt is a 32-bit application, so running under a Windows 64-Bit edition will access by default file and registry compatible information.

(An x64 version is in beta and can be found at http://www.autoitscript.com/autoit3/files/beta/autoit/)

For Files, Windows has a special redirection mechanism for some system directories :

Directories 32-bit Value 64-Bit Value

@SystemDir @windowsdir & "\SYSWOW64" @windowsdir & "\System32"

@ProgramFilesDir @SystemDrive & "\Program Files(x86)" @systemDrive & "\Program Files"

It is possible to access the 64-bit version of those directories by disabling the redirection mechanism.

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

Some more information can be found at MSDN.

For registry, use HKCR64 or HKLM64 to bypass the redirection mechanism see Registry Functions documentation.

To know if you are running under a 64-Bit Edition use @ProcessorArch macro.

Link to comment
Share on other sites

Thank you for the information, unfortunately, I am not well versed enough to fully understand what you were getting at.

I guess what I would like to know is why is this line causing the script to fail in x64?

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

Link to comment
Share on other sites

Thank you for the information, unfortunately, I am not well versed enough to fully understand what you were getting at.

I guess what I would like to know is why is this line causing the script to fail in x64?

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

Possibly, what is happening is Windows is looking in the wrong place for the AutoItX3 dll (using the redirection as Volly suggested). The script fails when it cant find the object.

Link to comment
Share on other sites

Possibly, what is happening is Windows is looking in the wrong place for the AutoItX3 dll (using the redirection as Volly suggested). The script fails when it cant find the object.

Does AutoITx3.dll even work on x64? There is a 64 bit beta version of AutoIT, however it does not include a beta version of the DLL.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...