I want to create simply batch script to copy my folders from my user profile to NAS using robocopy. I have written the script but it is not working. I have two files one is the script and second is the text file where I will put the folder paths to be copied to NAS. The scipt will use this text file. Following are the code snippets, batch file:
@echo off
for /f "tokens=*" %%v in (dir.txt) do (
echo:%%v
robocopy %%v h:\
)
text file (dir.txt)
"%userprofile%\desktop"
"%userprofile%\downloads"
"%userprofile%\My Documents"
"%userprofile%\Documents"
"%userprofile%\Favorites"
the batch script is unable to process file names from variable.
Thanks