For monitoring file changes in the Documents folder you can call this batch-file
from a previous scheduled task which you can create with SCHTASK
command:
@Echo OFF
REM By Elektro H@cker
PUSHD "%USERPROFILE%\Documents"
:: Recycle past session logs
Del /Q "%TEMP%\FileList.tmp","%TEMP%\FileListNew.tmp"
:Monitor_Loop
If Exist "%TEMP%\FileList.tmp" (
Dir /B /A-D > "%TEMP%\FileListNew.tmp"
Echo N | Comp "%TEMP%\FileList.tmp" "%TEMP%\FileListNew.tmp" 1>NUL 2>&1 || (
Echo File changes found on directory.
Call :FileOp
)
MOVE /Y "%TEMP%\FileListNew.tmp" "%TEMP%\FileList.tmp" 1>NUL
) ELSE (
Dir /B /A-D > "%TEMP%\FileList.tmp"
)
REM Ping -n 5 LOCALHOST 1>NUL
Timeout /T 5 1>NUL & REM Avoid Ping while you are in Windows 7/8.
GOTO :Monitor_Loop
:FileOp
For %%# in ("*") Do (Echo "%%~#")
GOTO:EOF
PS: Just add the operations that you need to perform with the new files found inside the :FileOp
procedure.
you maybe would like to use this VBScript
file to run the task/batch hidden:
' Run Hidden Process
' By Elektro H@cker
Process = """" & WScript.Arguments(0) & """"
Arguments = null
For X = 1 to WScript.Arguments.Count - 1
Arguments = Arguments & " " & _
"""" & WScript.Arguments(X) & """"
Next
WScript.CreateObject("WScript.Shell").Run _
Process & " " & Arguments, 0, False
Wscript.Quit