CMD Command To Open Command Prompt In Any Drive & Change Working Directory

Normally Windows DOS Prompt opens in Root directory only. Usually the Primary drive(root) is C drive and command prompt is open from C drive like C:\. Though by default command prompt opens in root drive only, we can make it open from any drive as we need. In this post let us see a list of methods to change the DOS Prompt working directory. There are registry tricks, CMD command, Windows Explorer trick etc to change the DOS root directory. In order to change your current command prompt directory from C drive to D drive, use any of the methods listed below.


 Cmd Command to Open Command Prompt in Any Directory

At first we can use simple DOS trick to open Command Prompt in any directory. To change the working directory from C drive to D drive from Command Prompt follow the steps below.

  1. Open Command prompt (Assume C:\)

  2. Type cd /d d:\ and press enter
    Open Command prompt in D directory, open in E directory

    Now your current Command Prompt directory will be D drive. This is one of the simplest methods to change C drive to D drive by using DOS command. This method works in most of the Windows versions like Windows 8, Windows 7, Windows XP etc.

Open Command Prompt Anywhere By Right Click On Windows 8 & Windows 7

Another simple method to open CMD in any drive is Windows explorer method. You can use this method to open DOS Prompt in Windows 8 and Windows 7 without any additional tweaks. So personally I prefer this method to open Command Prompt in any folder on Windows 7 and Windows 8 computers.
  1. Press [Shift] button and Right Click on any folder

  2. Click Open Command window here
    how to open drive in cmd using Command Prompt

  3. Command Prompt is opened in the folder
    how to open a drive in command prompt Windows 8 and Windows 7

You can open DOS Prompt by using this method in any working folder on Windows 7 and Windows 8. There is no restriction to use this method to open Command Prompt in any folder on your Windows 7 and Windows 8 computers.

Change Command Prompt Root Drive using Registry Edit On Windows XP

Normally you cannot get an option to open DOS Prompt in any folder on Windows XP computer as you see on Windows 8 and Windows 7 computers. However, you can open Command Prompt in any drive (C , D ,E , F etc), using a simple registry tweak on Windows XP computer. This registry tweak will allow you to open command prompt in any folder by a right click on it.

  1. Backup Registry Settings

    Playing with registry is critical and you are advised to create a backup of your registry before performing the steps below.
    How to Backup Current Windows Registry On Your Computer

  2. Click on Windows start and click on run

  3. On run type regedit and click OK

  4. On Registry editor go to the following key:

    HKEY_LOCAL_MACHINE\Software\Classes\Folder\shell

    Create a new key called Command Prompt.

  5. Create a new sub-key beneath the Command Prompt key called Command. Set the default value to

    Cmd.exe /k pushd % L

  6. Close the registry window
Now right click on any folder on Windows XP computer and check if you have the option to open Command Prompt. By using that option your can change command prompt from C drive to D drive.

Other Suggested Tutorials
  1. How to Access Services Window on Windows 8 & Windows 7

  2. You Don't Have Administrative Rights To Run The Command & Make Sure You Are in Administrative Account

  3. Start WLAN AutoConfig (WLANSVC Service) On Windows 8 & Windows 7 Computers

  4. I Do not Have The Permission to Access Control Panel

Technology Blog

2 comments:

Anonymous said...

Thanks

Jignesh Dawda said...

thanks bro it worked

my blog: http://myandroidgame.blogspot.com