I have a directory with lots of child directories.
I have a separate file that lists the child directories that need to be moved, list_of_numbers
. This is a long list of directory names
I want a batch file to read list_of_numbers
, create a new folder based on the line value, and copy the contents to the new folder with:
for /f "tokens=*" %%a in (H:Share1list_of_numbers.txt) do (
md "%%a"
xcopy "h:storage%%a*.*" "c:Users%username%Desktop%%a"
)
I keep getting the eror: The system cannot find the drive specified.
I presume it is the final destination, as creating the folder succeeds.
I am at a loss, as the command copy h:storage1000004*.* c:UsersfrankaDesktop1000004
worked when run in cmd prompt
I tried xcopy
, copy
, and other tags at the end, ie /S
, /Q
, but always receive the same error
2