I am new to batch files and created a batch file to back up a networked drive at work to my OneDrive folder so that I could access work files at home. Since then they have decided to install Office365 on everyones computer at work. Now instead of OneDrives folder just being called 'OneDrive' it is now called 'OneDrive - G&S Foods, Inc' My very simple batch file worked great until OneDrives name was changed. I cannot change the name back to just OneDrive, so I am trying to work around in my batch file. It seems the special characters are giving me an issue though, expecially the &. I now get the following error
Invalid number of parameters '&' is not recognized as an internal or external command, operable program or batch file.
My Question is: What is the best way to work around the special characters issue?
Here are my current script lines:
@echo off xcopy j:\Brandon C:\Users\bweibley\OneDrive - G&S Foods, Inc /m /e /y xcopy J:\Joe's Folder\ChocScheduleBackUps C:\Users\bweibley\OneDrive - G&S Foods, Inc\ChocScheduleBackUps /m /e /y