您的位置:首页 > 移动开发

How to add application to right click menu in Windows

2013-03-01 21:52 375 查看
/*

Author :Jiangong SUN

*/

You want to add an application for some types of files when you right click such files, but the system doesn't do it for you automatically. For this problem, you have some solutions.

For example, you need to open some types of files with one specific application all the time, you can right click the file and choose "open with" and then choose one specific application. But here we'll discover the other methods which need to make some
modifications in the registry.

In this case, you also have two possibilities: first, you need to display the application when you right click for a single type of file; second, you need to display the application for all types of files.

The first example we take will solve the first problem, I'll add ILDASM.exe to right click menu for dynamic link library files.

Type "regedit" in command line, unfold "HKEY_CLASSES_ROOT" directory, find "dllfile" directory, find sub-directory "shell", create it if you don't find it.

Then right click "shell" and click "New" -> "Key", name it as "ViewInILDASM". Then right click "ViewInILDASM" and click "New" -> "Key",
name it as "command".

You will find a "Default" key in "command" directory, assign the value "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\ildasm.exe" "%1" to it.

The structure will display like this:



The same process can be done for "exefile"



Another case is you need to add one application to all types of files. And you need to find "*" directory in the same root "HKEY_CLASSES_ROOT".

Find sub-directory "shell" in directory "*", create it if doesn't exist. Now you can click right "New" -> "Key", name it as "Open In Notepad".

And then create a sub directory "command". You will find a "Default" key in "command", assign value "C:\Windows\System32\notepad.exe %1" to it.

The final screen will be like:



Now we can make some tests in our system. I right click on a dll file, it will show like this:



Finally we have discovered the two ways of adding applications to right click menu. I hope it can do some help in your daily work.

Enjoy!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: