Change Default Command Prompt location?

Miscellaneous Forums/General Discussion/Change Default Command Prompt location?

How would you do this?

If you start it through a shortcut icon, you can just change the 'start in' line under the properties.

If you launch it through other means, I don't know what the 'proper' means is, but you can get it to work by making a change in the registry:

HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER) \ Software \ Microsoft \ Command Processor
There's a key called 'autorun' -- if you want it to default to another folder on your C:\ drive, you can just enter 'CD \myfolder\mysubfolder' under autorun, and any new command window will automatically change into that directory. doesn't work properly if your desired directory is on another drive, though...

What exactly do you need to change it's path for? Bit curious here, if it's to access it more easily, you could always just resort to hitting WindowsKey+R, type in cmd, hit enter.

One use that springs to mind would be to have it default to c:\program files\blitzmax\mod whenever I want to build a module.

But it wouldnt take you that long to just drop the dir on it to change it to the mod dir.
Dont get me wrong, I have it changed on mine, and in fact have a few shortcuts for it pointing to other places.
But if you just type cd, then drag/drop the dir on it, it will then use that dir

You can do it with a bit of preliminary fiddling.

1. Create a file called "cmddir.bat" in the root of C:
2. Edit this file to contain "cd <yourdefaultpath>".
3. Go to HKLM/Software/Microsoft/Command Processor in RegEdit.
4. Change the autorun value to the path of your batch file (c:\cmddir.bat in this case - you can call it what you want, and put it where you want).

Next time you go to command prompt, the batch file will be executed automatically (changing the path to the one in the batch file).

When you want to change the 'default' path in future, all you need to do is edit the batch file rather than messing about in the registry any more.

One use that springs to mind would be to have it default to c:\program files\blitzmax\mod whenever I want to build a module.


Why don't you just add %PROGRAMFILES%\BlitzMax\bin to your PATH environment variable - this is a list of directories, that Windows (and the command prompt) will look for programs if you just type in the name of the EXE, e.g. bmk makemods, even if you aren't in the folder.

Right-click 'My Computer', go to Properties, select Advanced (System Settings), click 'Environment Variable', and then under System Variables, select PATH, and add onto the end of the text that's already there...

;C:\Program Files\BlitzMax\bin

Or instead of fiddling with everything...

Do a google search for "W95DOSHERE"

It's an old Windows powertoy program. It installs a "command prompt here" selection when you right-click on folders in your windows explorer. Very handy as I can open the command prompt and be in the directory I want without typing in the "cd <directory path>".

Still works perfectly even in WindowsXP

Edit: arg, ofcoarse this option wouldnt chang ethe default location... need sleep... nite all

I have a MS powertoy installed...

http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx

called CmdHere.exe... from explorer you can right click on any folder and select to open a cmd window and you'll get your dos box startup in the folder..

Did that make sense ?

anyways.. I find it quite handy.