Greetings all, I have another batch file question, if anyone could help.
I have a text file that I would like to add last weeks date range to, and would like to have this done by a batch file.
the format to look like this:
Test020313to020913.txtany thoughts?

Pick a language that isn't batch. Both VBScript and PowerShell have date/time math, batch does not.
While avoiding batch is almost always the best answer, if it doesn't solve your issue it's probably not THE best answer. Speak more about your problem, and we'll see how it goes. For instance, what relationship does this date range have to the modified file date/time?
here's a vbscript rendition:
'==== begin vbscript "week.vbs"
'option to allow override of current date, else delete line and just use "date" for dd
if wscript.arguments.count=1 then dd=wscript.arguments(0) else dd=date
z=dateadd("d",-7-(datepart("w",dd)-1) mod 7,dd)
'split week beg & end-date elements (dmy) into array "p"
p=split(z&"/"&dateadd("d",z,6),"/")
'format for output: all elements two-digits zero-padded
for i=0 to 5
p(i)="0"&p(i)
p(i)=right(p(i),2)
next
'output looks like: 02/10/13/02/16/13 when inputdate is range 2/17-2/23
wscript.echo join(p,"/")
'===== end vbscript
batch:
for /f "tokens1-6 delims=\" %%a in ('cscript /nologo week.vbs') do set name=%%a%%b%%cto%%d%%e%%f
echo %name%
Powershell version: $someDate = Get-Date $SoW = $SomeDate.AddDays(-$someDate.DayOfWeek.value__) "{0:MMddyy}to{1:MMddyy}" -f $SoW, $SoW.AddDays(6)
