Eric wrote:
> I finished the rest code on the other day, does it look right?
No, you put the labels
![Smile (: (:](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
tuesday, :wednesday...) but you didn't put any
commands under the labels (except for the :friday label) and you didn't
put a goto at the end of the labels so the batch file will keep on
processing down the list of labels regardless of the day of the week.
Also, being that you're opening the same file ("D:/file1.xls")
regardless of the day so you can shorten the batch file with one label
only, try this instead:
======================================================================
@echo off
for /f "tokens=1 delims=/.- " %%A in ('echo %date%') do (set day=%%A)
for /f "tokens=1-2 delims=:." %%a in ('echo %time%') do (set tm=%%a%%b)
if /i %tm% LSS 900 goto eof
if /i %tm% GTR 1000 goto eof
if /i %day%==tue goto openfile
if /i %day%==wed goto openfile
if /i %day%==thu goto openfile
if /i %day%==fri goto openfile
goto :eof
![Eek! :o :o](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f631.png)
penfile
"D:/file1.xls"
======================================================================
John