Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hi, all. is it possible to write a batch file so that DOS will return the day of the week ?? I want a single Batch file to perform different tasks according to the day of the week. Please let me know if this is possible. Thanks a million.

Hi,
I think there is no such a command, but not so long I wrote little utility which you can use in a batch files. You run this utility with days of week in command line. The utility set errorlevel=0 if current day of the week matches with one of the
defined days and errorlevel=1 if not matches. If you want I can email it for free.Good luck, Igor M

Hi,
There is a small collection of com files in my Library that will allow you to make batch files that get the month....date ie 24th ...day of the week and the hour of the day.Like Igor I too would be happy to send them and also a demo bat that shows you how to use them.
Not intending to be rude, mean or rotten .......lol....you must first email me before I research them from the archives.
Some times people post but never return, so I dont do any floppy hunting until I get a yes send note.
I do wish you the best and let me know.World Library

Hi Igor M, World Librarian, thank for returning my questions..... and yes... if I can get a copy of both Igor and World Librarian's utility, that will be great.
I assume it is a small executable ? could you please send it to me via Email? my address is domdom@home.com
thanks
Dom

This is easy to do in batch!
Here is one way to do it:
(from a current post at
alt.msdos.batch)vol | date | find/i "sat" | if not errorlevel 1 goto saturday > nul
vol | date | find/i "sun" | if not errorlevel 1 goto sunday > nul
vol | date | find/i "mon" | if not errorlevel 1 goto monday > nul
vol | date | find/i "tue" | if not errorlevel 1 goto tuesday > nul
vol | date | find/i "wed" | if not errorlevel 1 goto wednesday > nul
vol | date | find/i "thu" | if not errorlevel 1 goto thursday > nul
rem Insert batch codes for Friday here
goto next
:saturday
rem Insert batch codes for Saturday here
goto next
:sunday
rem Insert batch codes for Sunday here
goto next
:monday
rem Insert batch codes for Monday here
goto next
:tuesday
rem Insert batch codes for Tuesday here
goto next
:wednesday
rem Insert batch codes for Wednesday here
goto next
:thursday
rem Insert batch codes for Thursday here
:next
rem rest of batch file, if anyFor batch solutions see newsgroup
alt.msdos.batch

Sure, piece of cake.
:: getday.bat
@ECHO off
ECHO. |DATE |FIND.EXE "Current" >temp.bat
ECHO SET day=%%3> current.bat
CALL TEMP.BAT
DEL temp.bat
DEL current.bat

![]() |
I Need a DOS (6.0-6.22)
|
Help
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |