Re: Changing directory in command prompt



In article <u8a2y1fZFHA.2768@xxxxxxxxxxxxxxxxxxxx>, "Peter Aitken"
<paitken@xxxxxxxxxxxxx> wrote:
>I need to execute a command line program in a specific folder. I have used
>Start, Run to open a command prompt but am having trouble using CD to change
>to the proper folder. The problem is that the path includes spaces. Thus
>
>CD program files
>
>does not work nor does
>
>CD "program files"

That should work, provided that the command prompt window is open in
the parent folder. For example, if you want to go to C:\Program
Files, then the command prompt must show "C:\"

>How can I get the command prompt to the proper folder?

A command prompt window typically opens in your user name's folder in
Documents and Settings. For example, mine opens in:

C:\Documents and Settings\Steve

To get to C:\Program Files, I can use either of these commands:

CD "C:\Program Files"
CD "..\..\Program Files"

The first one specifies a full path name including the drive letter.
The second one specifies a relative path name, using ".." to move up
one level at a time.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
.



Relevant Pages

  • Re: & Now, a Script to List the Running Process Info - Re: Useful little Script to Show the
    ... Done that to the desktop folder, ... at a Command Prompt, with the Name of the Script File (after a Space, ... a Folder where the Command Prompt Opens (either the Root of the ...
    (uk.people.silversurfers)
  • Re: Invoking NotePad from the Run Command
    ... This bat file is in a folder where the path of the ... Each time a Notepad opens a ... | text file, a command prompt window is open too. ...
    (microsoft.public.win2000.general)
  • Re: Cant delete folders
    ... Open a Command Prompt window and leave it open. ... and change to the directory the undeletable folder is located in. ... Go back to Task Manager, click File, New Task and enter ...
    (microsoft.public.windowsxp.general)
  • How do you set the dircmd environmental variable in XP?
    ... Yet when I reboot the computer, go to a command line screen and run "DIR" in any large folder, the subfolders and files are still displayed out of order and zoom by without pausing. ... After all, in Windows Explorer, folders and files are displayed in alphabetical order and you are allowed to scroll up and down the list. ... The least one could expect would be for files to be displayed as close to this as possible in a command prompt window. ...
    (microsoft.public.windowsxp.general)
  • Re: Command Prompt
    ... > to start up in the command prompt, ... > other icon I'd like to drag folders to it to start up the ... to it to start up the command prompt in that folder. ... cmd opens at the location of your choice! ...
    (microsoft.public.windowsxp.configuration_manage)