Reputation: 7916
I am attempting to monitor a program that may create and quickly delete files in a temporary folder. Is there a program or existing script that would monitor the creation of these files and copy them to another location so that I could view their contents? The files exist for too short of a time for me to copy them manually.
Upvotes: 2
Views: 1287
Reputation: 100
@echo off
setlocal enableDelayedExpansion
set CHECKDIR=C:\Temp\Check
set TARGETDIR=C:\Temp\Backup
pushd %CHECKDIR%
:loop
for /f "delims=" %%f in ('dir /b /a-d-h-s') do (
echo "Copying %TARGETDIR%\%%f"
copy %%f %TARGETDIR%\%%f
)
goto loop
popd
Upvotes: 4