1
0 Comments

What is the way to utilize a variable within a batch file to specify the root folder’s path when using the copy command?

set destination= "c:\destination folder"
mkdir %destination%

SET source = "C:\source folder\"
SET source_full = "C:\source folder\simple file.txt"

rem this doesn't work
copy %source%\"simple file.txt" %destination%

rem this works
copy %source_full% %destination%
Askify Moderator Edited question April 25, 2023