Lines 5-8 are repeated for 5 differnt files and seems to work for some and
not for others.
Does anyone have any suggestions to simplify this and make it more robust?
(For instance can "a" and "b" be saved and reused instead of repeating the
"For...." comand?)
1- rem @echo off
2 - set inc=12
3 - set Scr=c:\TempVBS.vbs
4 - echo WScript.Echo DateAdd("h", %inc%, Now()) > %Scr%
5 - for /F "tokens=1,3 delims=/ " %%a in ('cscript //nologo %Scr%') do if
not exist "C:\file %%a%%b.xls" goto nofile
6 - for /F "tokens=1,3 delims=/ " %%a in ('cscript //nologo %Scr%') do del
"C:\file %%a%%b.xls"
7 - :nofile
8- for /F "tokens=1,3 delims=/ " %%a in ('cscript //nologo %Scr%') do ren
"C:\file.xls" "file %%a%%b.xls"
9 - del %Scr%
--
Joe D