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?