Solved changing cmd prompt directory

August 8, 2005 at 14:00:06
Specs: Win XP Sv pack 2, 1.5/512 mb

Is there an easy way to change the command prompt to always go to a specific directory?

Mine goes to c:/documents and settings/neenie

But I want it to automatically go to about four subdirectories (subfolders...whatever) below 'neenie'.

As in c:/documents and settings/neenie/my documents/programming/language/c

Thanks!


See More: changing cmd prompt directory

Report •


✔ Best Answer
August 16, 2005 at 08:24:59

Hey there
I stumbled upon the same task today and found your post. I was lucky to find the solution to this.
Please visit http://windowsxp.mvps.org/autoruncmd.htm

or follow these steps

(1) At command prompt, type regedit.exe
(2) Navigate to "HKEY_CURRENT_USER\Software\Microsoft\Command Processor
(3) In the right hand panel, modify Autorun. If there is no Autorun present, Click Edit-> New->String Value
(4) Call it Autorun and type "cd\" if you want to set it to C: (provided Windows in installed on C drive). Say to want it to be C:\Abhi, type cd\Abhi.

I hope I am making this clear enough. I have tried it; and it works.

Sincerely
Abhijit



#1
August 8, 2005 at 14:38:27

Chdir (Cd)Displays the name of the current directory or changes the current folder. Used with only a drive letter (for example, chdir C:), chdir displays the names of the current drive and folder. Used without parameters, chdir displays the current drive and directory.

Syntax
chdir [[/d] [Drive:][Path] [..]] [[/d] [Drive:][Path] [..]]

cd [[/d] [Drive:][Path] [..]] [[/d] [Drive:][Path] [..]]

Parameters
/d
Changes the current drive or the current directory for a drive.
[drive:][Path]
Specifies the drive (that is, if it is different from the current drive) and directory to which you want to change.
[..]
Specifies that you want to change to the parent folder.
/?
Displays help at the command prompt.
Remarks
Working with command extensions
With command extensions enabled (that is, the default), the current directory path matches the folder names exactly as they appear on your hard drive, using the same uppercase or lowercase folder-name format. For example, if the folder on your hard drive is called C:\Temp, CD C:\TEMP sets the current directory to C:\Temp to match the folder-name format of the folder on your hard drive.

To disable command extensions for a particular process, type:

cmd e:off

When you disable command extensions, chdir does not treat white spaces as delimiters. As a result, you can change to a subdirectory name that contains a white space without having to surround [Path] in quotation marks. For example, the following path changes to the \Start menu subdirectory:

cd \winnt\profiles\username\programs\start menu

For more information about enabling and disabling command extensions, see cmd in Related Topics.

Changing to the root directory
The root directory is the top of the directory hierarchy for a drive. To return to the root directory, type:

cd\

Changing the default directory on one drive from another drive
To change the default directory on a drive different from the one you are on, type one of the following:

chdir [Drive:\[directory]]

cd [Drive:\[directory]]

To verify the change to the directory, type one of the following:

chdir [Drive:]

cd [Drive:]

The chdir command, with different parameters, is available from the Recovery Console.
Examples
When you use it with a drive name, chdir displays the current directory for that drive. For example, if you type cd c: at the C:\Temp directory prompt, the following appears:

C:\Temp

To change your current directory to a directory named Reports, type one of the following commands:

chdir \reports

cd \reports

To change your current directory to a subdirectory \Specials\Sponsors, type:

cd \specials\sponsors

Or, if your current directory is \Specials, type the following command to change to the \Specials\Sponsors subdirectory:

cd sponsors

To change from a subdirectory to its parent directory, type:

cd ..

To display the name of the current directory, you can use chdir or cd without a parameter. For example, if your current directory is \Public\Jones on drive B, typing chdir the following appears:

B:\Public\Jones

If you are working on drive D and you want to copy all files in the \Public\Jones and \Public\Lewis directories on drive C to the root directory on drive D, type:

chdir c:\public\jones

copy c:*.* d:\

chdir c:\public\lewis

copy c:*.* d:\

If you want to copy all files in the \Public\Jones and \Public\Lewis directories to your current location on drive D, type:

chdir c:\public\jones

copy c:*.* d:

chdir c:\public\lewis

copy c:*.* d:

i_XpUser


Report •

#2
August 8, 2005 at 15:27:53

Thanks, but I know how to switch from one directory to another from cmd.

My question was/is how can I change the command prompt to AUTOMATICALLY go to a specific directory?

Meaning, I want to have a cmd shortcut that will AUTOMATICALLY go a directory that I use all of the time. I already KNOW how to navigate from one directory to another from the prompt,...I want to set my command prompt to automatically go to a specific directory.

Specifically, instead of my command prompt automatically going to c:/doucuments and settings/neenie , I want it to AUTOMATICALLY go to c:/documents and settings/neenie/blah/blah blah/more blah/ blah blah blah

I can't think of any other way to make this more clear. But thanks anyway.


Report •

#3
August 8, 2005 at 22:17:55

Good response from XpUser... a little bit acid from meanie!

Once I thought I was wrong, now I'm not so sure!


Report •

Related Solutions

#4
August 10, 2005 at 14:04:53

I have same question: Everytime I open my CMD, It opens into my H:\> dir, instead of C:\>. This happens to all login users to network, running Windows xp and login into AD/wind 2003, running Kix a login script from sysvol.
Is anyone knows what it caused for command to open into Home directory? and How I can change so it shouhd open into either current user profile or local C: drive ?


Report •

#5
August 10, 2005 at 21:52:11

aamar butt you should repost your question as a fresh post. It is unlikely that anyone will find it tacked onto the end of someone elses.

Once I thought I was wrong, now I'm not so sure!


Report •

#6
August 16, 2005 at 08:24:59
✔ Best Answer

Hey there
I stumbled upon the same task today and found your post. I was lucky to find the solution to this.
Please visit http://windowsxp.mvps.org/autoruncmd.htm

or follow these steps

(1) At command prompt, type regedit.exe
(2) Navigate to "HKEY_CURRENT_USER\Software\Microsoft\Command Processor
(3) In the right hand panel, modify Autorun. If there is no Autorun present, Click Edit-> New->String Value
(4) Call it Autorun and type "cd\" if you want to set it to C: (provided Windows in installed on C drive). Say to want it to be C:\Abhi, type cd\Abhi.

I hope I am making this clear enough. I have tried it; and it works.

Sincerely
Abhijit


Report •

#7
September 8, 2005 at 13:29:37

Thanks for posting that! I also stumbled upon this website and that was VERY helpful information!!

Thanks!
-Brittny

Check out:

http://ipods.freepay.com/?r=10871112 and get a free iPod!!


Report •


Ask Question