Jump to content

Modify Windows Contextmenu - (Moved)


Recommended Posts

  • Moderators

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

hi dear
you can do Such as the following
first choose your ext that you want to add the entry on it
if you want to add it to all exts then use *, or you can use .text for examples
then select your name and icon and your script / program path

#RequireAdmin
$ext = ".txt"
$name = "open with notepad"
$icon = "c:\test.ico"
$path = "c:\Windows\system32\notepad.exe" & " %1"
if not ($ext = "*") then
$read = RegRead("HKEY_CLASSES_ROOT\" & $ext, "")
if @error then
$ext = StringReplace($ext, ".", "") & "File"
else
$ext = $Read
endIf
else
$ext = "*"
endIf
$HKCR = "HKCR"
if @OSArch = "x64" then $HKCR = "HKCR64"
RegWrite($HKCR & "\" & $ext & "\shell\" & $name, "", "reg_sz", $name)
RegWrite($HKCR & "\" & $ext & "\shell\" & $name, "Icon", "reg_sz", $icon)
RegWrite($HKCR & "\" & $ext & "\shell\" & $name & "\command", "", "reg_sz", $path)
exit


i hope this can help you
Link to comment
Share on other sites

here is an example about what you want brother

#RequireAdmin
    $ext = ".txt"
$mainName = "custtome menu"
$mainIcon = "c:\test.ico"
$mainPosition = "Top"
;avalable options (Top and middle or  Bottom)
    $name1 = "open with notepad"
$icon1 = "c:\test1.ico"
$path1 = "c:\Windows\system32\notepad.exe %1"
    $name2 = "Delete file"
$icon2 = "c:\test2.ico"
$path2 = 'c:\Windows\System32\cmd.exe /c Del "%1" & exit'
    If Not ($ext = "*") Then
    $read = RegRead("HKEY_CLASSES_ROOT\" & $ext, "")
    If @error Then
        $ext = StringReplace($ext, ".", "") & "File"
    Else
        $ext = $read
    EndIf
Else
    $ext = "*"
EndIf
$HKCR = "HKCR"
If @OSArch = "x64" Then $HKCR = "HKCR64"
    ;writing the main menu
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName, "MUIVerb", "REG_SZ", $mainName)
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName, "Icon", "REG_SZ", $mainIcon)
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName, "ExtendedSubCommandsKey", "REG_SZ", $ext & "\shell\" & $mainName & "\Options")
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName, "Position", "REG_SZ", $mainPosition)
    ;writing the sub menu
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName & "\Options\shell\" & $name1, "MUIVerb", "reg_sz", $name1)
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName & "\Options\shell\" & $name1, "Icon", "reg_sz", $icon1)
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName & "\Options\shell\" & $name1 & "\command", "", "reg_sz", $path1)
    
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName & "\Options\shell\" & $name2, "MUIVerb", "reg_sz", $name2)
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName & "\Options\shell\" & $name2, "Icon", "reg_sz", $icon2)
RegWrite($HKCR & "\" & $ext & "\shell\" & $mainName & "\Options\shell\" & $name2 & "\command", "", "reg_sz", $path2)
    Exit

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...