Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: backup batch file to recognize day names  (Read 8609 times)

0 Members and 1 Guest are viewing this topic.

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: backup batch file to recognize day names
« Reply #30 on: April 30, 2018, 08:18:21 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.

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: backup batch file to recognize day names
« Reply #31 on: April 30, 2018, 08:59:36 AM »
 8)
" Anyone who goes to a psychiatrist should have his head examined. "