-2

I need help on how do you open a file or copy a file to a destination that has spaces in it.

copy C:\Users\\OneDrive\Desktop\MyFile\download.jpg C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

pause
  • 2
    Possible duplicate of [How do I use spaces in the Command Prompt?](https://stackoverflow.com/questions/6376113/how-do-i-use-spaces-in-the-command-prompt) – phuclv Oct 31 '18 at 04:43
  • [How to write a full path in a batch file having a folder name with space?](https://stackoverflow.com/q/7347501/995714), [pathnames with spaces in batch script](https://stackoverflow.com/q/23253725/995714) – phuclv Oct 31 '18 at 04:45

1 Answers1

2

You need to add "" to your source and destinations.

copy "C:\Users\\OneDrive\Desktop\MyFile\download.jpg" "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
John Kens
  • 1,615
  • 2
  • 10
  • 28