Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[SRC]Add Item To Windows Executable RightClick Menu!

Hey! A guy asked me on msn yesterday how you would add an item to the windows default right click menu when you right click any .exe file, so i googled up what registry keys had to be created and here's what i came up with. It's a simple function let you add your own item to the right click menu of executable files. (Thanks nathan my drunk friend for giving me an example on how to change the default value of a subkey :p)

Btw this require UAC to work.

Code
Private Function doAddToList(ByVal itemName As String, ByVal itemPath As String, ByVal itemArgs() As String)
  Dim regkey : regkey = CreateObject("wscript.shell") : Dim keyValue = Chr(34) & itemPath & Chr(34)
  If Not itemArgs.Length < 1 Then
    For i = 0 To itemArgs.Length - 1
    keyValue &= itemArgs(i)
    Next
  End If
  Try
    regkey.regwrite("HKEY_CLASSES_ROOT\*\shell\" & itemName & "\command\", keyValue, "REG_SZ")
  Catch
    Return False
  End Try
  Return True
    End Function

To use the function:

Code
If doAddToList("Item Name", "File Path", ArgumentArray) Then
    MsgBox("Success!") ' Successfully added item
  Else
    MsgBox("Fail!") ' Failed to add item
  End If

I added the ArgumentArray for people using console applications and wanting to open, edit, delete or modify the file in any way. Please read my tutorial on passing arguments to a console application here: https://hackforums.net/showthread.php?tid=488166

If you do not know how to create a simple string array with arguments, here's an example:

Code
dim argArray() as string = new string() {"-arg1", "-arg2", "-arg3"}

Another neat little thing i discovered is that if you add an argument like this:

Code
dim argArray() as string = new string() {"-%1", "-arg2", "-arg3"}

the "-%1" will return the full path of the file you right clicked! 😉

Here is a picture of when passing the "%1" argument to a console application:

[IMG]http://i350.photobucket.com/albums/q408/ubbe12/asfsfaaf.png[/IMG]

Thats it! :p Hope you can read my awful english.
Probably coding some useless shit.
You deserve a fucking medal for posting this!!<3
ohh this is awesome...This is very useful..More non hacking things in this section...I actually love it :P

Btw: YOur English is good...Or i am just blind..lol
(Jun 18, 2010 06:05 AM)StRaXxXD Wrote:  ohh this is awesome...This is very useful..More non hacking things in this section...I actually love it :P

Btw: YOur English is good...Or i am just blind..lol

Yup i'm tired of all the "L33T KEYLOGGERS" in the .net section.
Probably coding some useless shit.
Add a right click any .exe "Crypt" option like Japa did! Cool post UbbeLoL!
I fucking love you I'd +rep you if I didn't already. :D
(Jun 18, 2010 06:35 AM)Apple Wrote:  I fucking love you I'd +rep you if I didn't already. :D

Thank you alot :p Have fun with it
Probably coding some useless shit.
This is really good mate! thanks for the share UbbeLoL!
(Jun 18, 2010 06:35 AM)iRtehLeet™ Wrote:  Add a right click any .exe "Crypt" option like Japa did! Cool post UbbeLoL!

Japa made it in Delphi if i'm not wrong.

Cool post UbbeLoL!
Thanks for posting this, should be easy to use it in other languages.
Thanks a lot UbbeLoL! Very useful :)
i already knew this but nice post
but i never ever knew what to do with this
maybe if u code ur own .net reflector xD
(Jun 18, 2010 08:45 AM)MCart Wrote:  Thanks a lot UbbeLoL! Very useful :)

Thank you very much MCart. :)

Bump! :p
Probably coding some useless shit.
Thank you very much for posting this.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by iRazorOct 15, 2021 12:35 PM 3 157 Oct 15, 2021 12:35 PM
Last Post: steel iron
[Shell] by Emre_Jan 12, 2021 11:16 PM 0 141 Jan 12, 2021 11:16 PM
Last Post: Emre_
[Shell] by Emre_May 30, 2020 05:19 AM 5 237 May 30, 2020 05:19 AM
Last Post: Emre_