Normally Windows DOS Prompt opens in Root directory only. Usually, the Primary drive(root) is C and command prompt is open from C drive like C:\. Though by default DOS opens in root drive only, we can make it open from any drive as we need. For a normal user, this article may not be very useful but if you want to run any script on DOS which are directory specific, this tutorial will help you. We can change the DOS working directory by following any trick from a list of methods. There are registry tricks, CMD command, Explorer trick etc to change the DOS root directory. In order to change your current DOS directory from C drive to D, use any of the methods listed below.
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 DOS, follow the steps below.
Another simple method to open CMD in any drive is explorer method. You can use this method to open DOS Prompt in Windows 8 and 7 without any additional tweaks. So personally I prefer this method to start DOS Window in any folder on Windows 7 and 8 computers.
You can open DOS Prompt by using this method in any working folder on Windows 7 and 8. There is no restriction to use this method to start it in any folder. You can even open it on any subfolders in any directory.
Normally you cannot get an option to start DOS Prompt in any folder on XP computer as you see on Windows 8 and 7 computers. However, you can start it in any drive (C, D, E, F, etc..), using a simple registry tweak on XP computer. This registry tweak will allow you to run it in any folder by a right click on it.
Technology Blog
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 DOS, follow the steps below.
- Start DOS (Assume C:\)
- Type cd /d d:\ and press enter
Now your current working directory will be D drive. This is one of the simplest methods to change C to D drive by using DOS. This method works in most of the Windows versions like Windows 8, 7, XP etc.
Open Command Prompt Anywhere By Right Click On Windows 8 & Windows 7
Another simple method to open CMD in any drive is explorer method. You can use this method to open DOS Prompt in Windows 8 and 7 without any additional tweaks. So personally I prefer this method to start DOS Window in any folder on Windows 7 and 8 computers.
- Press [Shift] button and Right Click on any folder
- Click Open Command window here
- It is opened in the chosen folder
You can open DOS Prompt by using this method in any working folder on Windows 7 and 8. There is no restriction to use this method to start it in any folder. You can even open it on any subfolders in any directory.
Change Command Prompt Root Drive using Registry Edit On Windows XP
Normally you cannot get an option to start DOS Prompt in any folder on XP computer as you see on Windows 8 and 7 computers. However, you can start it in any drive (C, D, E, F, etc..), using a simple registry tweak on XP computer. This registry tweak will allow you to run it in any folder by a right click on it.
- Backup Registry Settings
Playing with the registry is critical and you are advised to create a backup of your registry before performing the steps below.
How to Backup Current Registry On Your Computer
- Click on Start and click on run
- On run type regedit and click OK
- On Registry editor go to the following key:
HKEY_LOCAL_MACHINE\Software\Classes\Folder\shell
Create a new key called Command Prompt.
- Create a new sub-key beneath the Command Prompt key called Command. Set the default value to
Cmd.exe /k pushd % L
- Close the registry window
Other Suggested Tutorials
- How to Access Services on Microsoft OS
- You Don't Have Administrative Rights To Run The Command & Make Sure You Are in Administrative Account
- Start WLAN AutoConfig (WLANSVC Service) On Computers
- I Do not Have The Permission to Access Control Panel
Technology Blog
thanks bro it worked
ReplyDeletemy blog: http://myandroidgame.blogspot.com
Very nice article. I absolutely love this site.
ReplyDeleteStick with it!
www.techhousewiki.com