If you have PowerShell, you can use this instead:
cd *<targetdirectory>*
ls -r |% { $_.FullName } | Set-Content foldercontents.txt
I will only raise it, because then you can compare the next time you check the differences:
$original = Get-Content foldercontents.txt;
$now = ls -r |% { $_.FullName }
Write-Host "Missing Files:";
$original |? { -not $($now -contains $_) };
Write-Host "Added Files:";
$now |? { -not $($original -contains $_) };
source
share