;~ 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)