DOS question

  • Thread starter Thread starter PT
  • Start date Start date
P

PT

I need to include in a batch file a folder whose name includes an embedded
space For example if the folder is named c:\JOHN SMITH, I'd like to include
a statement of the form CD \JOHN SMITH. It won't work because of the
embedded blank space between the two names.

In the "DOS" environment how do I enter this command.
 
PT said:
I need to include in a batch file a folder whose name includes an
embedded space For example if the folder is named c:\JOHN SMITH, I'd
like to include a statement of the form CD \JOHN SMITH. It won't
work because of the embedded blank space between the two names.
In the "DOS" environment how do I enter this command.

cd "john smith"
cd johnsm~1
cd jo* [if there is only one match]
 
As Gordo says in his short reply, the path should be enclosed in quotes
anytime a space is included in the statement.

The command:
Xcopy "C:\documents and settings\gordo\*.*" d:\
will copy every file in the gordo directory to the root of the D: drive.

For your example it should be CD "\john smith" where the full path would be
the default drive (no drive letter is specified before the back slash (\))
and the folder immediately off the root folder called John Smith.





Gordo said:
PT said:
I need to include in a batch file a folder whose name includes an
embedded space For example if the folder is named c:\JOHN SMITH, I'd
like to include a statement of the form CD \JOHN SMITH. It won't
work because of the embedded blank space between the two names.
In the "DOS" environment how do I enter this command.

cd "john smith"
cd johnsm~1
cd jo* [if there is only one match]
 
PT said:
I need to include in a batch file a folder whose name includes an
embedded space For example if the folder is named c:\JOHN SMITH, I'd
like to include a statement of the form CD \JOHN SMITH. It won't
work because of the embedded blank space between the two names.

In the "DOS" environment how do I enter this command.

Put quotes around it.
 
Back
Top