pt

Distinguished
Apr 16, 2004
354
0
18,780
Archived from groups: microsoft.public.windowsxp.basics (More info?)

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
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.basics (More info?)

PT wrote:
> 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.

--
<- Shenan ->
--
The information is provided "as is", it is suggested you research for
yourself before you take any advice - you are the one ultimately
responsible for your actions/problems/solutions. Know what you are
getting into before you jump in with both feet.
 

Gordo

Distinguished
May 21, 2004
40
0
18,530
Archived from groups: microsoft.public.windowsxp.basics (More info?)

PT wrote:
> 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]
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.basics (More info?)

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" <gordo20878@hotmail.com> wrote in message
news:u8BawrktEHA.1452@TK2MSFTNGP11.phx.gbl...
> PT wrote:
> > 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]
>
>