Actually, I tried my method before ask you another one, and it doesn't work.
BUT i've found a solution for my problem
For those interested, what I needed in my script was to get the last log file, and copy it on a server. That's why I wanted to give a name that I (and the script) know.
To by-pass this problem, I've make a little .bat script which selects the most recent txt file, and copies it in c:\temp\test.txt.
Code:
for /f "tokens=4* delims= " %%i in ('dir /o:d "C:\Documents and Settings\All Users\Application Data\Spybot - Search & Destroy\Logs\*.txt" ^| findstr /i /c:".txt"') do set VrFchRcnt=%%i %%j
echo %VrFchRcnt%
echo "creation of the txt file" > c:\temp\test.txt
xcopy "C:\Documents and Settings\All Users\Application Data\Spybot - Search & Destroy\Logs\"%VrFchRcnt% c:\temp\test.txt /Y
In this way, during my script I can copy this file which will always be the one that I want.
Thanks for the help