Create TXT file of copied files after XCOPY

June 7, 2011 at 02:28:29
Specs: Windows 7
I am wondering, is it also possible to create a batch command that will automatically create a TXT file of the files that have been copied after copying all the files with the XCOPY command.

I have created a whole batch command:

@echo off

set path=c:\WINDOWS\system32;

echo Copying started at %date% %time%>>date.txt

echo source directory ? set /p source= echo destination directory ? set /p dest= xcopy %source%*.doc %dest%\ /s /a /d

echo Copying finished at %date% %time%>>date.txt

echo Completed Successfully at %date% %time%>>date.txt

echo --------------------------------------------------------------------------- >>date.txt


Thanks in advance! :))

See More: Create TXT file of copied files after XCOPY

Report •

June 7, 2011 at 10:24:38
Your code has mistakes, e.g. never modify the PATH system variable. Here the code where the second XCOPY with /L just lists the files (and doesn't copy them).

@echo off
echo Copying started at %date% %time%>> date.txt

set /P source=source directory^>
set /P dest=destination directory^>

xcopy %source%.\*.doc %dest%.\  /S /A /D
xcopy %source%.\*.doc %dest%.\  /S /A /D /L >> data.txt

echo Completed Successfully at %date% %time%>> date.txt
echo --------------------------------------------------------------------------- >>date.txt

Report •
Related Solutions

Ask Question