I am using robocopy to copy from one directory to another.
I have tested the code using miscellaneous source directories but I get an error when executing one particular directory:
set "source=C:\Program Files (x86)\Phoresis\Backup"
I get the error:
Invalid paramter 3 "(x86)\Phoresis\Backup"
Have tried using single quotes and have wrapped the variable assignments in "" as there are spaces in the directory paths.
Code:
set "newDirectory=F:\Cap2 Flex Backup"
REM Timesatmp a new folder
set "DirName=%date:~-4,4%.%date:~-7,2%.%date:~0,2%.%time:~0,2%.%time:~3,2%
MD \%newDirectory%"
set "source=C:\Program Files (x86)\Phoresis\Backup"
robocopy %source% %DirName% /e /z /Mir
Struggling to get my head around spaces/special characters in vb scripts/batch so any input appreciated.
Cheers