0

Every time I run the Command Prompt on my machine (Windows 7 Professional, 64bit), the default message tells me on which folder my commands are active, as the CLI has "sent" me there:

enter image description here

the problem is that I don't want to be directed every single time on my C:\...> Drive.

First of all, it's dangerous to a non-expert user like me, because in my ignorance I may press and enter the command format by mistake; and second of all, I don't examine or edit files or folders inside it very much.

Since I made a partition on my HD, I created a document storage D:\> drive that contains all of the non-executable programs or connections; and I'd appreciate if the Command Prompt will be able to redirect by default on that disk.

After some research I found some sort of workaround: creating a desktop shortcut (renamed CLI~DOS) and setting the start in: option to D:\; at the end it worked:

enter image description here

but I'd like to know if there is a way (non hacking esoteric RegEdit messing up) that allows me safely to change my default starting folder to D:\> without creating other shortcuts. If it doesn't exist, is it correct to have more than one shortcut of the Command Prompt?

  • @Downvoter If you think that the question itself does not show any research effort, or is un-useful or un-clear, please justify your downvote. Also, what is the reason to do this after someone posted a good accepted answer? – TheVal Jan 31 '14 at 17:13
3

You could probably right-click the command prompt at tell it to "Start In" wherever you like. However, just typing format doesn't do anything, you would have to give it at least a drive letter (and be an admin), and I doubt it would be able to format the system drive.


You can only apply this setting to shortcuts anyhow. When you go to c:\windows\system32 which contains the actual cmd.exe you will notice that its properties don't have a "Start in". The executable will simply put you into the directory you start it from. What physically changes when you manipulate the shortcut's properties is the .lnk file that contains the properties of the shortcut and that you don't see like that.

When the CLI puts you into your home, doesn't mean that the shortcut has to be there. In essence you have three things:

1) The actual cmd.exe in System32.

2) Shortcuts, everywhere (desktop, start menu, .....) pointing to that

3) Your home directory.

Having the shortcuts start the program with a default directory of your home doesn't mean there needs to be a shortcut there. That's merely the config of the shortcut, which can be whatever you want it to be.

| improve this answer | |
  • So, by applying the same procedure of CLI~DOS to the "authentic" command propt, I deduce that I won't mess up with anything, right? Well, if so, I'm curious about what physically changes when I do that. – TheVal Jan 26 '14 at 11:34
  • You can only apply this setting to shortcuts anyhow. When you go to c:\windows\system32 which contains the actual cmd.exe you will notice that its properties don't have a "Start in". The executable will simply put you into the directory you start it from. What physically changes when you manipulate the shortcut's properties is the .lnk file that contains the properties of the shortcut and that you don't see like that. – Marki Jan 26 '14 at 11:42
  • Ok, it won't matter whenever I decide to correctly change the start in: field of a .lnk file, because it will redirect always to the original cmd.exe. On a last, maybe superfluous note: why when I go into C:\Users\Andrea I don't see the shortcut? – TheVal Jan 26 '14 at 11:48
  • When the CLI puts you into your home, doesn't mean that the shortcut has to be there. In essence you have three things: 1) The actual cmd.exe in System32. 2) Shortcuts, everywhere (desktop, start menu, .....) pointing to that 3) Your home directory. Having the shortcuts start the program with a default directory of your home doesn't mean there needs to be a shortcut there. That's merely the config of the shortcut, which can be whatever you want it to be. – Marki Jan 26 '14 at 11:54
  • Perfect Explanation, Thanks! If you'll add these ueful comments inside your answer, I'll gladly accept it. – TheVal Jan 26 '14 at 11:56
3

You can find the answer you're looking for here: Changing default startup directory for command prompt in Windows 7.

In your case specifically, go to

HKEY_CURRENT_USER\Software\Microsoft\Command Processor

Create new string value named Autorun and set its value to cd /d D:\.

| improve this answer | |
  • I'm glad you took the time to answer, but as I stated, this is an esoteric forbidden way. I know it's efficent, but I had some "issues" with RegEdit and I don't want to use it anymore only if extremely necessary. Thank you anyway. – TheVal Jan 26 '14 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.