Set AHK Studio as default when not installed?

Editor for AutoHotkey written completely in AutoHotkey.

Moderator: maestrith

User avatar
kunkel321
Posts: 1042
Joined: 30 Nov 2015, 21:19

Set AHK Studio as default when not installed?

20 Feb 2021, 13:38

Hi There,
I'm not an "administrator" of my laptop, so I can't install things, or edit things in Prog Files or Prog Files(x86). Interestingly, I have SciTE at the location C:\PortableApps\AutoHotkey\SciTE\SciTE.exe and I have AHK Studio at the location C:\PortableApps\AutoHotkey\AHK-Studio-master\AHK-Studio.exe.

I'm using Win 10, and if I go to "Choose default app for each file type," then SciTE is listed as an option, but AHK Studio is not. As you know, there's no option to browse for other apps.

So why does SciTE.exe appear there and AHK-Studio.exe does not? Is there a way to make AHK-Studio the default without installing it??

EDIT: I want to make it the default app for .ahk files.... In case that wasn't obvious.
EDIT2: AHK Studio does seem to have a command to "Set as default editor" but that doesn't seem to work... (I guess because it's not installed?)
ste(phen|ve) kunkel
User avatar
kunkel321
Posts: 1042
Joined: 30 Nov 2015, 21:19

Re: Set AHK Studio as default when not installed?

20 Feb 2021, 14:09

Hey, I think I got this to work! Of course the solution only occurs to me AFTER I post on the forum. Not sure why that's always the case.

Anyhoo... I used a couple of NirSoft tools. FileTypesMan.exe let me manually set it to use AHK Studio. Of course you can't run FileTypesMan if you're not an administrator. AdvancedRun.exe let me run it anyway. Kinda kludgy, but it worked. I'll post another reply if this setup gives me any problems later.
ste(phen|ve) kunkel
gregster
Posts: 9000
Joined: 30 Sep 2013, 06:48

Re: Set AHK Studio as default when not installed?

20 Feb 2021, 15:27

Not sure if you can use example #2 from here if you are not admin: https://www.autohotkey.com/docs/commands/Edit.htm#ExDefaultEditor
https://www.autohotkey.com/docs/commands/Edit.htm#ExDefaultEditor wrote:If your editor's command-line usage is something like Editor.exe "Full path of script.ahk", the following can be used to set it as the default editor for ahk files. When you run the script, it will prompt you to select the executable file of your editor.

Code: Select all

FileSelectFile Editor, 2,, Select your editor, Programs (*.exe)
if ErrorLevel
    ExitApp
RegWrite REG_SZ, HKCR, AutoHotkeyScript\Shell\Edit\Command,, "%Editor%" "`%1"
User avatar
kunkel321
Posts: 1042
Joined: 30 Nov 2015, 21:19

Re: Set AHK Studio as default when not installed?

20 Feb 2021, 15:55

Cool. I didn't try the script, but I think I did find the REG_SZ at location: Computer\HKEY_CLASSES_ROOT\.ahk_auto_file\shell\open\command No doubt this is the one that NirSoft's FileTypesMan changes.
ste(phen|ve) kunkel

Return to “AHK Studio”

Who is online

Users browsing this forum: No registered users and 25 guests