Jump to content
AnonymousX

[Solved] Scripts opening in editor instead of running

Recommended Posts

So I just got a new computer, and instantly went and installed Autoit onto it. I selected run script as default action when clicking on an au3 file, however every time I do this it opens the script in the editor. I can from there run the script no problem.

I've tried reinstalling and checking the settings by hitting "Ctrl+1" and have confirmed it is set to run, but yet it just continues to open in the editor.

Any ideas why this is happening or how to solve?

New system is windows 10, old was windows 7

Edited by AnonymousX

Share this post


Link to post
Share on other sites

This means you have changed the default as the AutoIt3 installer will use Run() as default.
Did you also install SciTE4AutoIt3?

If so: run SciTEConfig and select option Other tools/Run AutoIt3/SciTE check. The top part of the output will tell you whether you have still a standard install setting in the registry or if you have modified that. Can you post that information here so I can have a look?

Jos

Edited by Jos

Share this post


Link to post
Share on other sites

@Jos

 

All I did was go to:

https://www.autoitscript.com/site/autoit/downloads/

download Autoit and download the editor. It had checked off the default of run not open editor but still always opens it rather than runs.

For good measure I tried uninstalling and reinstalling one more time but got the same results.

 

******************************************************************************************************************************************
!*  Found always open with Win7    :Applications\SciTE.exe
!*  Fixed by removing Registry key : "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Userchoice"
* HKCR\.au3 Default       :AutoIt3Script
* HKCR\.au3 ShellNew      :C:\WINDOWS\SHELLNEW\Template.au3 (File Exists)
******************************************************************************************************************************************
* Explorer shell options:
* HKCR\AutoIt3Script\shell: 
*  => Default Action:Run
*     Compile                => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"
*     Compile with Options   => Command:"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /ShowGui /in "%l"
*     CompileX64             => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe_x64.exe" /in "%l"
*     CompileX86             => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"
*     Edit                   => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1"
*     Open                   => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1"
*     Run                    => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %*
*     RunX64                 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "%1" %*
*     RunX86                 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %*
******************************************************************************************************************************************
* User SciTE info:
*    SCITE_USERHOME:C:\Users\anom\AppData\Local\AutoIt v3\SciTE: 
*    Directory missing: C:\Users\anom\AppData\Local\AutoIt v3\SciTE\SciTE Jump
*    SciTEUSer.Properties: 
*-----------------------------------------------------------------------------------------

import au3.UserUdfs
import au3.keywords.user.abbreviations
******************************************************************************************************************************************

 

Share this post


Link to post
Share on other sites

@Jos

 

Okay so I went into the editor hit "ctrl+1" then tried switching it over to edit instead of run. Restarted computer. 

So then it said edit, switched it back to run, and restarted again and it seems to be working properly now!

I don't know why that happened but everything is good. 

Share this post


Link to post
Share on other sites

As you can see in the output from SciTEConfig: There was a manual "Always Open with" done one time on this computer, so it will indeed give the issue you describe as swapping between Run/Open doesn't do anything when this is the case. The Output does suggest the fix as well and to remove the described registry key.

Jos 

Share this post


Link to post
Share on other sites

@Jos

The issue came back so I'm guessing I need to do as you mentioned and removed the registry key. How is the best way to do this?

Run an Autoit script:

RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Userchoice")

?

*edit* It didn't so much come back rather I fixed it for 1 particular file and noticed when opening a second file it was back to opening rather then running.

Edited by AnonymousX

Share this post


Link to post
Share on other sites

You could simply open the regedit and do it manually. I didn't want to do it in the script but merely indicate what the issue is.

Jos

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

  • Similar Content

    • By Xandy
      What's new section:
      Snowman_Sky is game using MapIt engine.  MapIt will evolve here for a little bit.
      Download: [ http://songersoft.com/programming/Snowman_Sky.zip ]
      Video demonstrating new sprite_sheet class and weather effect.
      Working on the Class section of the Character Sheet.
      Which is what makes multiclassing possible.

      Changing the value of Class will load the stored value for XP.  Lvl will be updated to the XP tier.
      Hit points are then rolled for each level of all learned classes.  Hit dice are specific to each class and a Constitution modifier is added to each roll of hit die.
       
    • By ademon
      Hi. I can open the editor with out problems but I can not compile because it is placed on another partition diferent from C.
      Can you provide an update of this bug?


    • By HariKara
      Hi AutoIters!
       
      Im trying to launch a .exe file that is nested within the program files (x86) folder structure. i have already used the standard RunAs Syntax and found that it fails to launch the application. I have switched to Run and that seems to work. My issue is I have to use RunAs as the applicaton would need to run under a completely different account. The Current logged in user is a Local User on the machine, however, the application must be run as a domain user. The Machine is domain connected.
       
       have tried the following:
      RunAs("username","logonpassword", $RUN_LOGON_PROFILE, "D:\Program Files (x86)\Vendor\Application Name\Exe Location\Executable.exe") The above fails to launch, there are no errors or syntax issues, it just does nothing when the variables are replaced for the correct values.
      I did the same using the Run command
      Run("D:\Program Files (x86)\Vendor\Application Name\Exe Location\Executable.exe") That seems to work fine, but runs in local user context. Any thoughts? Could it be a local Machine rights issue? Or have i missed something glaring in my script
    • By nacerbaaziz
      Hello
      i have searched a lot about how to run external programs with the administrator privileges without the script running with administrator privileges using autoit
      But all my attempts failed
      Finally, today I found the VBS function doing this task
      I immediately transferred it to our beloved language (autoit) and i decided to share it with you
      i hope you like it
      This is a simple example about how to use the function

      runAsAdmin("cmd.exe", "/c @echo off & cls & echo test & pause", "c:\", @sw_show)
      this is the function

      func runAsAdmin($program, $parameters = "", $workingDir = @workingDir, $show = "") local $oShell = OBJCreate("Shell.Application") if isOBJ($oShell) then local $result = $oShell.ShellExecute($program, $parameters, $workingDir, "runas", $show) else $result = false endIf return $result endFunc
       
    • By PoojaKrishna
      Hi friends,
      The Run command on my machine suddenly stopped execution.
      Anyone of you facing the same issue?
      #include <AutoItConstants.au3> #include <FileConstants.au3.> #RequireAdmin $ExeName = FileOpenDialog("Select AutoIt executable", @ScriptDir & "\", "(*.exe)", $FD_FILEMUSTEXIST) If not @error Then If FileExists($ExeName) Then $iPID = Run($ExeName, "", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) If @error Then msgbox(0,"Failed", "Failed execution with @error: " & @error) EndIf Else Msgbox(0,"", "File does not exist") EndIf EndIf The above code always fails to execute the executable file. It was working perfect and stopped working now.
      I have tried adding the files and folders to windows defender exclusion list and uninstalling the anti virus but still no luck.
      OS: Windows 10 - 64 bit
      Please help.
       
×
×
  • Create New...