VBScript XCopy

I am trying to execute a simple script to copy folders from one location to another using XCopy, and it works ok if I do not have spaces in the filepath.  The problem is when I do, it doesn't work.  Here is what I have so far.

Set oShell = CreateObject("WScript.Shell")
strCommand = oShell.Run("Xcopy D:\source\folders D:\destination\ /X /E", 0, True)

If I change it to
strCommand = oShell.Run("Xcopy D:\source\my folders D:\my destination\ /X /E", 0, True)
then it does not work.

I've tried double quotes chr34 and all that, but haven't nailed it yet.  What is the proper syntax to get this to work?  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try this.

Set oShell = CreateObject("WScript.Shell")
oShell.Run "Xcopy " & Chr(34) & "D:\source\folders" & Chr(34) & _
    " " & Chr(34) & "D:\my destination\" & Chr(34) & " /X /E", 0, True

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
B1izzardAuthor Commented:
It works.  Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.