Sign in to follow this  
Followers 0
martytheman

Basic script Issue - Program not Showing ( .Net dll )

3 posts in this topic

Hi - I think your Documentation is outdated?

I have been reading the help file "Using the .NET Interface"

I can't get anything like what is there to work.

the closest I can get is to reference AutoItX3.dll

Then I try the C# code..

            AutoItX3Lib.AutoItX3 a = new AutoItX3();
            a.Run("notepad.exe", @"c:windows");
 
It appears to run notepad but it isn't visible - it just creates a process.
 
I am using a 64 bit machine - even if I register and reference the 64 bit dll - it does the same.
 
Ideas? 
 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi, I am a new user of AutoIt  (Just started today) and this code worked just fine for me.  I am using it inside of a plugin for Autocad.  Thus the commandmethod attribute.

You need to reference AutoItX3.Assembly.dll and not the AutoItX3.dll. There is no need to register any dll.   If you distribute your application then you need to make sure to distribute AutoItX3.Assembly.dll, AutoItX3.dll, and AutoItX3_x64.dll as well.

using Autodesk.AutoCAD.Runtime;
using AutoIt;

namespace Brow.MepUtilities

public Class TestCommands
{
    [CommandMethod("Notepad")]
    public static void Notepad()
    {
        AutoItX.Run("Notepad.exe", @"C:\Windows");
    }
}
Edited by KeithABrown

Share this post


Link to post
Share on other sites
            AutoItX3Lib.AutoItX3 a = new AutoItX3();
            a.Run("notepad.exe", @"c:windows");
 

 

i think this will be correct

remove @ symbol before C:Windows

 

these are working for me in autoit script file

Run("notepad.exe",)
Run("notepad.exe",@WindowsDir,@SW_SHOW)
ShellExecute("notepad.exe","",@WindowsDir)

Share this post


Link to post
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
Sign in to follow this  
Followers 0