Subj : .bats To : Spiro Dotgeek From : Paul Hayton Date : Sat Oct 18 2014 12:34:55 I'm having a moment, can you help? :-) I just want to set up a .bat file in my windows box to take a log file, rename it with a date/timestamp and then move /copy it off to another dir. It's the setting of date/time vars and/or calling them correctly when I try to envoke a rename command on the target file that eludes me. I found the following but it's not setting the date/time var up correctly and does not work c: cd\hub\logs for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a" set "YY=%dt:~2,2%" set "YYYY=%dt:~0,4%" set "MM=%dt:~4,2%" set "DD=%dt:~6,2%" set "HH=%dt:~8,2%" set "Min=%dt:~10,2%" set "Sec=%dt:~12,2%" set datestamp=%YYYY%%MM%%DD% set timestamp=%HH%%Min%%Sec% set fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec% ren "c:\hub\logs\fecho.txt" "%fullstamp%.txt" goto done `I'm not expendable, I'm not stupid, and I'm not going' - Kerr Avon, Blake's 7 --- Mystic BBS v1.10 A52 (Windows) * Origin: Agency BBS | telnet://agency.bbs.geek.nz (3:770/100) .