Robocopy

I am trying to copy 750+ directories with sub diectories from one drive to another using robocopy.  If i type it into the DOS window it works fine.  However, since it is such a large number of directories, I am putting this into a batch file.  Some of the lines inthe batch file works as expected but there are lines where the directory has a space in it  it does not work.  It thinks ther space is the end of the line.
When I run the line:
robocopy “M:\fixed\Alanis Morissette” “O:\music\Alanis Morissette” /s

I see:
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows

-------------------------------------------------------------------------------

  Started : Wed Oct 28 12:46:09 2015

   Source - M:\"M:\fixed\Alanis\
     Dest - M:\Morissette"\

    Files :
  Options : /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

ERROR : Invalid Parameter #3 : ""O:\music\Alanis"

       Simple Usage :: ROBOCOPY source destination /MIR

             source :: Source Directory (drive:\path or \\server\share\path).
        destination :: Destination Dir  (drive:\path or \\server\share\path).
               /MIR :: Mirror a complete directory tree.

    For more usage information run ROBOCOPY /?


****  /MIR can DELETE files as well as copy them !

M:\>



I wrote the batch file in word so that I could edit and replace as needed, and then copied it to notepad and saved it as a txt file that I then renamed to a ".bat"
CeredAsked:
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.

NVITCommented:
Not sure but possibly due to the way Word converted the quotes.

Posting your code will help better.
0
Joe Winograd, Fellow&MVEDeveloperCommented:
The problem is your left and right quote marks. The left is x'93'/147; the right is x'94'/148. Change them both to a normal quote ("), which is x'22'/34. Regards, Joe
0
CeredAuthor Commented:
Joe,
Not sure what you mean I replaced them with a normal quote and it did not work.
0
NVITCommented:
One way...
When you save is Word, choose Type, Plain Text, MS-DOS. In the option, choose Allow character substitution.

If using notepad, just find and replace each quote.
Note: left and right quotes differ so you have to do it for each.
0
Joe Winograd, Fellow&MVEDeveloperCommented:
If you replaced all of the quotes that Word created with a standard quote mark after-the-fact, e.g., in Notepad or any text editor, then it will work. But you may stop it from occurring in the first place by telling Word not to use the so-called "smart quotes". To do that, follow these steps (will depend somewhat on what version of Word you have):

File
Options
Proofing
AutoCorrect Options
AutoFormat

Un-tick the box to replace straight quotes with smart quotes:

Word replace straight quotes
The syntax you posted is correct and it will work as soon as you have straight quotes, not smart quotes, in the batch file. Btw, that's why the seemingly same command worked fine in the DOS prompt — because when you type in there and hit the quote key, it generates a standard quote; but when you hit the quote key in Word, it creates the smart quote, because the default is to have the checkbox that I circled in the screenshot ticked. Regards, Joe
1

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
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
Windows 7

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.