Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#3742 closed Feature Request (Rejected)

Locate Windows Shell context menu items in an extra menu

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

When AutoIt is installed, it creates about seven new menu-items for the explorer context menu, when right-clicking a .au3 file. Three "Compile" versions, an "Edit" and three "Run" versions. Can these please be grouped in a menu, so the explorer menu looks cleaner?


It's really easy, just by creating the right registry keys and values. Currently individually written to [HKEY_CLASSES_ROOT\AutoIt3Script\Shell]. Obviously, I don't need to tell you how this works, but for those who want to know, or do it themselfs: I would suggest the following keys and values here:

KEY "AutoItMenu"
- REG_SZ "MUIVerb" = "AutoIt"
- REG_SZ "Icon" = "C:\Program Files (x86)\AutoIt3\AutoIt3.exe"
- REG_SZ "SubCommands" = "AutoIt_Compile;AutoIt_Edit;AutoIt_Run"

And then create inside [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell] the following …

KEY "AutoIt_Compile"
@ (default) = "Compile script"
- KEY "command" = "C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"

KEY "AutoIt_Edit"
@ = "Edit script"
- KEY "command" = "C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1"

KEY "AutoIt_Run"
@ = "Run script"
- KEY "command" = "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %*

I'll leave the solution for the ability to choose between x86 and x64 versions to you.

Attachments (1)

Place AutoIt shell context menu items inside menu.au3 (2.6 KB) - added by anonymous 4 years ago.
script file with same content as mentioned in my comment

Download all attachments as: .zip

Change History (5)

comment:1 Changed 5 years ago by TicketCleanup

  • Version 3.3.14.0 deleted

Automatic ticket cleanup.

comment:2 Changed 4 years ago by Jpm

I try your proposal but it not working with Win10
Unless you give me better advice I will close this ticket
Cheers

comment:3 Changed 4 years ago by Jpm

  • Resolution set to Rejected
  • Status changed from new to closed

comment:4 Changed 4 years ago by anonymous

This is the script that I used. It hides the default menu-items, creates a new sub-menu and new keys that will be visible in the sub-menu. Found it somewhere on the AutoIt forum. I did a quick search, but didn't find the post. Sorry for that.

;~ Note: Nothing will be deleted, so it is perfectly safe
#RequireAdmin

Global $HKCR_AutoItMenu = "HKEY_CLASSES_ROOT\AutoIt3Script\Shell\"
Global $HKLM_Shell = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\"

; disable the loose context menu items...
RegWrite($HKCR_AutoItMenu&"Compile", "LegacyDisable", "REG_SZ", "")
RegWrite($HKCR_AutoItMenu&"CompileX64", "LegacyDisable", "REG_SZ", "")
RegWrite($HKCR_AutoItMenu&"CompileX86", "LegacyDisable", "REG_SZ", "")
RegWrite($HKCR_AutoItMenu&"Edit", "LegacyDisable", "REG_SZ", "")
;~ RegWrite($HKCR_AutoItMenu&"Open", "LegacyDisable", "REG_SZ", "") ; don't want to disable this one, because that will break the ShellOpen of a .au3 file ; same as either Edit or Run action, depending on your personal settings
RegWrite($HKCR_AutoItMenu&"Run", "LegacyDisable", "REG_SZ", "")
RegWrite($HKCR_AutoItMenu&"RunX64", "LegacyDisable", "REG_SZ", "")
RegWrite($HKCR_AutoItMenu&"RunX86", "LegacyDisable", "REG_SZ", "")

; create a new menu...
RegWrite($HKCR_AutoItMenu&"AutoIt_Menu")
RegWrite($HKCR_AutoItMenu&"AutoIt_Menu", "ICON", "REG_SZ", "C:\Program Files (x86)\AutoIt3\AutoIt3.exe") ; default file location, check if you installed it somewhere else
RegWrite($HKCR_AutoItMenu&"AutoIt_Menu", "MUIVerb", "REG_SZ", "Auto-It") ; text to display
RegWrite($HKCR_AutoItMenu&"AutoIt_Menu", "SubCommands", "REG_SZ", "AutoIt.Compile;AutoIt.Edit;AutoIt.Run") ; create new commands that will be registered later

; register the new commands, copy default values...

RegWrite($HKLM_Shell&"AutoIt.Compile", "", "REG_SZ", "Compile script") ; menu-item text
; choose the one you want to use:
$value = RegRead($HKCR_AutoItMenu&"Compile\command", "")
;~ $value = RegRead($HKCR_AutoItMenu&"CompileX64", "command")
;~ $value = RegRead($HKCR_AutoItMenu&"CompileX86", "command")
RegWrite($HKLM_Shell&"AutoIt.Compile\command", "", "REG_SZ", $value)

RegWrite($HKLM_Shell&"AutoIt.Edit", "", "REG_SZ", "Edit script") ; menu-item text
$value = RegRead($HKCR_AutoItMenu&"Edit\command", "")
RegWrite($HKLM_Shell&"AutoIt.Edit\command", "", "REG_SZ", $value)

; this one won't be used if you did not disable the default context menu item
;~ $value = RegRead($HKCR_AutoItMenu&"Open", "command")
;~ RegWrite($HKLM_Shell&"AutoIt.Open\command", "", "REG_SZ", $value)

RegWrite($HKLM_Shell&"AutoIt.Run", "", "REG_SZ", "Run script") ; menu-item text
; choose the one you want to use:
$value = RegRead($HKCR_AutoItMenu&"Run\command", "")
;~ $value = RegRead($HKCR_AutoItMenu&"RunX64", "command")
;~ $value = RegRead($HKCR_AutoItMenu&"RunX86", "command")
RegWrite($HKLM_Shell&"AutoIt.Run\command", "", "REG_SZ", $value)

Changed 4 years ago by anonymous

script file with same content as mentioned in my comment

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.