1.

Solve : backup batch file to recognize day names?

Answer» QUOTE from: RonC on April 28, 2018, 10:19:37 AM
Sorry people, I may have screwed up and my celebration was premature. I tried the coding you suggested and it didn't work. Here is the code for my bat file:
@echo off
cd\
cd\Users\RONALD\Desktop
if /i "%dayname%"=="Monday" copy current*.* f:\monday /y
if /i "%dayname%"=="Tuesday" copy current*.* f:\tuesday /y
if /i "%dayname%"=="Wednesday" copy current*.* f:\wednesday /y
if /i"%dayname%"=="Thursday" copy current*.* f:\thursday /y
if /i "%dayname% =="Friday" copy current*.* f:\friday /y
if /i "%dayname% =="saturday" copy current.* f:\saturday /y

When I RUN the bat file and then OPEN the directory f:\saturday it is empty. Am I not properly identifying a variable? I can't figure it out.

Thanks,

RonC
This code should have GIVEN you an error. You are missing a double quote for the comparison on Friday and Saturday.


Discussion

No Comment Found