xcopy does not work when DIR has space i.e PROGRAM FILES ?

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

xcopy /s c:\dir\*.ocx c:\program files\application\

cant get this to work because there is a space in PROGRAM FILES dir. When
space is removed its ok.

How can i deal with this using xcopy ?

thanks
scott
 
You will have to do some searching in the comand prompt ... but you will
notice that the DOS version of the program files directory is somthing like
"program~1" rather than "program files".

Check this bu opening a command prompt.

type "cd\"
type "dir/w"

then look at the DOS folder name ... it will be different because naming
convestions have chag somewhat since DOS was created.
 
scott said:
xcopy /s c:\dir\*.ocx c:\program files\application\

cant get this to work because there is a space in PROGRAM FILES dir.
When space is removed its ok.

How can i deal with this using xcopy ?

thanks
scott

xcopy /s c:\dir\*.ocx "c:\program files\application\"

Andrew
 
scott said:
xcopy /s c:\dir\*.ocx c:\program files\application\

cant get this to work because there is a space in PROGRAM FILES dir. When
space is removed its ok.

How can i deal with this using xcopy ?

thanks
scott

xcopy expects two parameters: SourcePath DestinationPath
(plus any number of switches).

Parameters are separated by spaces (like words in the
English language).

Now have a look at your command:
xcopy c:\dir\*.ocx c:\program files\application\
It appears to have three parameters (3 words)!
- c:\dir\*.ocx
- c:\program
- files\application

Solution: Use double quotes for parameters that include one or
more spaces!

xcopy /s c:\dir\*.ocx "c:\program files\application\"
 
Sir Rawlins said:
You will have to do some searching in the comand prompt ... but you will
notice that the DOS version of the program files directory is somthing like
"program~1" rather than "program files".

Check this bu(meaning?) opening a command prompt.

type "cd\"
type "dir/w"

then look at the DOS folder name (no DOS in Win2000!) ...
it will be different because naming convestions(meaning?)
have chag(meaning) somewhat since DOS was created.

Not very good advice. A far better solution is to enclose
such file and folder names with double quotes . . .
 
Sorry ... thats a good point from peagus ... was early doors for me this
morning ... not on full steam ..

Think i may have just put salt in my tea .....
 

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

Similar Threads


Back
Top