xcopy with embedded spaces in the file name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i need help...

I have a problem, the file name has embedded blanks i need to put double
quotes "" around the file name, but how?
here is the code:

Call Shell("xcopy " & DocPath & " C:\ /Y")

Tks in advance
Mario
 
You could use the built-in filecopy command...it works fine with spaces:


filecopy fileSource, fileDestination

using the above means you dont have to use shell.....
 
Tks Albert for the suggestion.
I agree if use the Filecopy instead of the old xcopy commands i solve my
problem, I code the following and i got: "Path Not Found":

Dim DocPath As String
Dim Models_Location As String
Models_Location = "C:\"
FileCopy DocPath, Models_Location

I'm a neewby in VB.
 
Albert;

Your suggestion is Good!
I got "Path Not Found" because i don't specify the file name of the
destination.

Final code:

FileCopy DocPath, Models_Location & File_Name

Tks
 
Back
Top