Xcopy script with log file

@echo off
set logFile=C:\Log\copyfiles_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.log
set sourcePath=C:\sourcePath
set targetPath=C:\targetPath
set tempFile=%temp%\copyfiles.tmp

if exist %tempFile% del %tempFile% >  nul
echo ================================================================= >> %logFile%
echo Starting copying audio files >> %logFile%
Date < nul >> %tempFile%
echo . >> %tempFile%
time < nul >> %tempFile%
findstr current %tempFile% >> %logFile%
del %tempFile%


xcopy.exe %sourcePath%\*.* %targetPath% /s /d /c /y /H /M >> %logFile%

echo All done. >> %logFile%
Date < nul >> %tempFile%
echo . >> %tempFile%
time < nul >> %tempFile%
findstr current %tempFile% >> %logFile%

Comments

Popular posts from this blog

Extracting and using a modified VMWare Player BIOS or UEFI firmware

Activate Synology Active Backup for Business for DSM 6

Windows 11 internet/account bypass