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
pause
Thanks in advance! :))
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 pause
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |