Windows Explorer contextual menu gotcha

Recently I had to extract the public key from a signed .NET assembly and I needed to run the sn.exe tool in order to obtain it. That required opening a command prompt and then setting the current directory to the one in which the assembly resided.

Typically I did :

  1. Win+R (Run)
  2. cmd
  3. Enter
  4. F: [ENTER] (or whatever the drive was)
  5. CD and either type the directory (using the TAB autocomplete or not) or copy the folder path and pasting it into the command prompt [ENTER]

Then I thought how can I simplify this little tedious task, which I sometimes do many times a day. After looking for Microsoft PowerToys which is no longer available I found out a little gem hidden in Windows Explorer. This is what my contextual menu looks like normally :

But just pressing (and keeping pressed) SHIFT before the right-click will give you this :

Selecting this command will do the opening of the command prompt and setting the drive and path in one click.

Of course, the next thing is to add the path to SN.EXE in the Environment Variable PATH in order to be able to execute it “anywhere”.

I hope this helps at least some of us 🙂

  1. cmd.exe also supports Paste option as input from the keyboard shortcut ctrl+v as well as from the contextual window menu (click on the “favicon” of cmd -> Edit -> Paste)

    So you can open a CMD anywere, and if you know the path just navigate with CD [paste path here] 🙂

  2. Quick trick : Copy file path | Andrei Rinea's technical blog - pingback on 4 February 2015 at 15:38

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trackbacks and Pingbacks: