3

I've pinned a Command Prompt to the taskbar. I set it to open in Administrator mode. When I click on it, it opens in c:\windows\system32.

I'd like it to start in c:\code. To that end, I right-clicked on the pinned icon, selected properties and changed the value in the Start in textbox to c:\code directory. However, it's not having the right effect.

So how can I get a pinned Command Prompt window to open in a certain directory?

AngryHacker
  • 18,217
  • 67
  • 156
  • 209

1 Answers1

7

When you edit the Properties of the pinned Command Prompt, instead of changing the "Start In" value, add the following to the "Target" value:

/K cd C:\code

So that your target should look something like:

%windir%\system32\cmd.exe /K cd C:\code

You can also Shift+Right-Click in any open Explorer window and click "Open Command Window Here" to open a Command Prompt from any open folder, if you didn't know.

Josh
  • 5,143
  • 5
  • 34
  • 44