Jump to content

How to start autoit script from VSCode?


Recommended Posts

I am trying to run *.au3 script from VSCode. I installed some plugins: Damien, 4ern, Code Runner but non of them could be used for this aim. Code editor works fine and the code is highlighted, but if I try to run the code I get an error: 

Line 0 (File "c:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3");

Error: Error opening the file.

The script works fine by running it from SciTE editor

Edited by Vitaliy4us
Link to comment
Share on other sites

There's several ways to do this, you could compile the script to an executable and run that, you could add the AutoIt3.exe to the PATH variables so that the command line can run it from anywhere. If you want to just run a file without these two, this works:

string pathToAutoIt;
            string pathToScript;
            pathToAutoIt = @"C:\Program Files (x86)\AutoIt3\AutoIt3.exe";
            pathToScript = @"\path\to\script.au3";
            Process externalProcess = new Process();
            externalProcess.StartInfo.FileName = pathToAutoIt;
            externalProcess.StartInfo.Arguments = pathToScript;
            externalProcess.Start();
            externalProcess.WaitForExit();
            externalProcess.Dispose();

 

Link to comment
Share on other sites

I personally use the damien.autoit extension and have no problem.

Have you verified that the AutoIt3Wrapper.au3 file exists at the location?

Edit:

If no, then try installing this: https://www.autoitscript.com/site/autoit-script-editor/downloads/

Edited by genius257
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...