xcopy with embedded spaces in the file name

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
 
A

Albert D. Kallal

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.....
 
G

Guest

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.
 
G

Guest

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
 

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

Top