Tailor to fit.
In closing, I don't offer to write the code for you since it's your code to create and maintain.
Bob
![]() | Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years. Thanks, CNET Support |
Hello,
I want to write a small batch file to open certain documents on my computer when I log on, that quite easy a certain document only needs to be open on fridays so I need to find a way of checking the system date and then using something like. I asked elsewhere but didnt get much help, a guy said something about using a VBscript although I have no experience in VB, and little in batch file scripting.
if date ==friday
then open myfile.doc
else
end
Can anyone give me some help with this?
I am using XP BTW.
Cheers
Mike
EDIT: I plan to put the .BAT file in my start folder and hope to run a check daily to see if day == friday.
Discussion is locked
Thanks for the info, I was thinking though...I need to work with the date as a sring such as "Friday" but I think I can only get a numeric value from DOS.
Do you know this to be true? or..do you think what i am trying to do is possible another way?
thanks again
Mike
That's a new requirement. Please explain in detail why the dayofweek test must be for friday and not the number of the day of the week.
Bob
Well I want to say something like:
if %DAY% == friday
then START myfile.doc
ELSE
END
if I have a numeric date then that value will change, for instance tomorrow is 08/.. next week 15/.. etc, when the month changes the pattern does too, some months have 31 some 28 and some 30. How would I reference an ever changing number value with only a bash script?
Mike
The DAYOFWEEK is from 0 to 6 or 1 to 7, not the day of the month.
Tell me why it must be Friday and not the number again.
Bob