This really shouldn't be this hard, but Windows it making it a million times harder than it should be...
I have a list of files (with relative paths) in a text file named newfiles.txt and I want to copy all those files to another directory.
I created this batch file:
but when I run it like this:
it only sees one command line argument "C:\Temp", so no files are copied.
Why isn't that working?
All I want to do is backup (either copy to another directory, zip or tar) the files listed in newfiles.txt.
Is there an easier way to do what I want?
I have a list of files (with relative paths) in a text file named newfiles.txt and I want to copy all those files to another directory.
I created this batch file:
Code:
@ECHO OFF
SETLOCAL
SET dest=%1
:Begin
SHIFT
IF "%1"=="" GOTO End
XCOPY %1 %dest%\%1
GOTO Begin
:End
ENDLOCAL
Code:
CopyFiles.bat C:\Temp < newfiles.txt
Why isn't that working?
All I want to do is backup (either copy to another directory, zip or tar) the files listed in newfiles.txt.
Is there an easier way to do what I want?