Command Line Confusion

  • Thread starter Thread starter Wayne Wengert
  • Start date Start date
W

Wayne Wengert

If I execute the following set of commands I see the contents of the
directory as expected:

cd \
cd Documents and Settings\Wayne
dir

But.. if I execute the following command:

dir \Documents and Settings\Wayne
or
dir \Documents and Settings\Wayne\*.*

I get "The system cannot find the file specified."


What am I missing here? I admit that I do very little DOS anymore but this
seems pretty basic?
 
Wayne Wengert said:
If I execute the following set of commands I see the contents of the
directory as expected:

cd \
cd Documents and Settings\Wayne
dir

But.. if I execute the following command:

dir \Documents and Settings\Wayne
or
dir \Documents and Settings\Wayne\*.*

I get "The system cannot find the file specified."


What am I missing here? I admit that I do very little DOS anymore but this
seems pretty basic?

All file and folder names that have embedded spaces
must be surrounded by double quotes. There is one
exception to this rule: The "cd" command does not
require the double quotes.

dir "\Documents and Settings\Wayne\*.*"
 
Wayne Wengert said:
If I execute the following set of commands I see the contents of the
directory as expected:

cd \
cd Documents and Settings\Wayne
dir

But.. if I execute the following command:

dir \Documents and Settings\Wayne
or
dir \Documents and Settings\Wayne\*.*

I get "The system cannot find the file specified."


What am I missing here?

In addition to Pegasus' reply:
You may also want to use the short path name, supplied by "DIR /x".
Example: DIR \DOCUME~1\Wayne
 
hanks for the advice guys. I forgot about the problem of spaces

Wayne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top