Computing.Net > Forums > Disk Operating System > can Batch File return day of week?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

can Batch File return day of week?

Reply to Message Icon

Name: Dom
Date: November 15, 1998 at 22:12:28 Pacific
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Igor M
Date: November 16, 1998 at 09:54:00 Pacific
Reply:

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


0

Response Number 2
Name: World Library
Date: November 16, 1998 at 17:54:27 Pacific
Reply:

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


0

Response Number 3
Name: Dom
Date: November 23, 1998 at 21:07:25 Pacific
Reply:

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


0

Response Number 4
Name: Chris
Date: November 25, 1998 at 22:04:08 Pacific
Reply:

Go to PCMAG web site. Over the past couple of years they have published several .BAT soloutions.


0

Response Number 5
Name: Outsider
Date: March 14, 1999 at 22:54:33 Pacific
Reply:

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 any

For batch solutions see newsgroup
alt.msdos.batch


0

Related Posts

See More



Response Number 6
Name: Outsider
Date: August 21, 1999 at 11:25:07 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

I Need a DOS (6.0-6.22) Help



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: can Batch File return day of week?

Finding day of week www.computing.net/answers/dos/finding-day-of-week/11384.html

get date without day of week www.computing.net/answers/dos/get-date-without-day-of-week/11833.html

Help!! Batch File www.computing.net/answers/dos/help-batch-file/13525.html