Open command prompt from any folders context menu

There are many tools that can do that for You, but it easy to make it yourself.

When a user right-clicks a Shell object such as a file, the Shell displays a shortcut (context) menu. This menu contains a list of commands that the user can select to perform various actions on the item. These commands are also known as shortcut menu items or verbs. Shortcut menus can be customized.

What you have to do is just add some registry entry in [HKEY_CLASSES_ROOT\Folder\shell\.

All entries here are responsible for what menus to show when you press right menu button and open context menu for a folder.

Command cmd.exe /K \”cd /d %1\”” will open command prompt and navigate to current folder (%1 will by replaced by folder name You are opening context menu automatically )

More on this here.

Save this to any .reg file and execute it:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\CMD\command]
@=”C:\\Windows\\System32\\cmd.exe /K \”cd /d %1\””

Removing BOM characters from UTF8 file using Power-Shell (converting UTF8 with BOM to UTF8 without BOM)

When creating UTF8 encoded files using Power-Shell, for example:


$orcFile = "testFile.txt"

Add-Content -Encoding UTF8 $orcFile "bla bla bla"

they are created with BOM (byte order mark) and if there is a need of a just plain UTF8 – we have a problem.

The byte order mark (BOM) is a Unicode character, U+FEFF BYTE ORDER MARK (BOM), whose appearance as a magic number at the start of a text stream can signal several things to a program consuming the text:

  • What byte order, or endianness, the text stream is stored in;
  • The fact that the text stream is Unicode, to a high level of confidence;
  • Which of several Unicode encodings that text stream is encoded as.

One of the solutions would be just removing BOM characters from the file itself:


#remove utf BOM  from file

$orcFile = "testFile.txt"

(Get-Content $orcFile) |

Foreach-Object {$_ -replace "\xEF\xBB\xBF", ""} |

Set-Content $orcFile