Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For Windows 7 and above, I constantly ran into a situation like: go to THE_DIRECTORY and do something. Every time I have to copy THE_DIRECTORY and use Win+E to open an Explorer, and then paste the special string THE_DIRECTORY to the address box, and then press Enter key.

How do I add an item named "Open in Explorer" to right-click context-menu after I have selected some text? I have already searched HowToGeek, but without any luck. Could someone shed some light on how to do this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Here is a basic example of a shell extension from the example in this thread.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\Open_in_Explorer]
"MUIVerb"="Open_in_Explorer_By_KNUCKLE_DRAGGER"
"icon"="Explorer.exe"
"Position"="Top"

[HKEY_CLASSES_ROOT\Directory\Background\shell\Open_in_Explorer\command]
@="cmd /c start /wait /b powershell -command \"Clear-Host;$CLIPBOARD = PowerShell -NoProfile -STA -Command {[reflection.assembly]::loadwithpartialname('PresentationCore') | Out-Null;[Windows.Clipboard]::GetText()};C:\\Windows\\Explorer.exe $CLIPBOARD\""
;

Still working on how to make the magic happen, I think powershell maybe has a [Windows.Clipboard]::GetText() method we can use.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.