Is that the EXACT script you use? Because I see a syntax error here:
Code:SET FILENAME=%WD_FILE_N:~,4%
(something missing before the comma).
I am not sure what you try to achieve with this line of code, but if you want to get the first 4 chars of the filename, use
Code:SET FILENAME=%WD_FILE_N:~0,4%
The last 4 chars, use
Code:SET FILENAME=%WD_FILE_N:~-4%
Everything except the first char, use
Code:SET FILENAME=%WD_FILE_N:~1%
Everything except the last char, use
Code:SET FILENAME=%WD_FILE_N:~,-1%
If you want to debug your filter script, create a NEW filter script like below:
Code:rem the file to write all output to, WD_CUREVT contains a unique number for the event
rem so the output file will be something like C:\temp\WDLOG_3124.txt
SET DEBUGOUTPUT=C:\temp\WDLOG_%WD_CUREVT%.txt
rem the batch file to call (bat or cmd)
SET SCRIPTTOCALL=C:\Program Files (x86)\WatchDirectory\Resolvers\MyFilterScript.bat
rem output all variables to DEBUGOUTPUT
ECHO ----- start environment listing ----- >> "%DEBUGOUTPUT%"
SET WD_ >> "%DEBUGOUTPUT%"
ECHO ----- end environment listing ----- >> "%DEBUGOUTPUT%"
ECHO ----- start output of script %SCRIPTTOCALL% ----- >> "%DEBUGOUTPUT%"
rem call the batch script, redirecting all output to DEBUGOUTPUT
Call "%SCRIPTTOCALL%" >> "%DEBUGOUTPUT%" 2>&1
ECHO ----- end output of script %SCRIPTTOCALL% ----- >> "%DEBUGOUTPUT%"
and inspect the txt file it creates to see if any problems occur.