Search code examples
batch-filespace

How to open destination with spaces in batch


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

Solution

  • 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"