ShipUPride Posted August 13, 2007 Share Posted August 13, 2007 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 belowCODE' Require Variants to be declared before usedOption Explicit Dim oShellDim oAutoItSet 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 MessageScript: TEST.vbsLine: 8Char: 1Error: Could not create object named "AutoITX3.Control".Code: 80040154Source: WScript.CreateObjectThis script works perfectly fine on our XP 32 Bit ComputersI'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.dllI 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 More sharing options...
Bert Posted August 13, 2007 Share Posted August 13, 2007 Running under Windows 64-bit EditionAutoIt 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. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ShipUPride Posted August 13, 2007 Author Share Posted August 13, 2007 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 More sharing options...
Reaper HGN Posted August 13, 2007 Share Posted August 13, 2007 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 More sharing options...
ShipUPride Posted August 13, 2007 Author Share Posted August 13, 2007 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 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