Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am working with SBS w2k3 Server Spanish version.
I need the day of week to do a msdos script.
if I put 'date /t' shows dd/mm/yyyy format, I don't need this. I need ddd, dd/mm/YYYY format. Can you help me, please??

control panel > regional > date
=====================================
If at first you don't succeed, you're about average.M2

First, Excuse me for my English, it is very bad.
I know I can choose date format in Control Panel. But only shows dd/mm/yyyy format in ms-dos, I can not change it.
I try to explain me better.
I am doing a ms-dos script. When I put 'date /t' in command line only shows the format I say before, and I want the day of week. I will be crazy finding it.

Right! I don't mind if it is in English or Spanish, but I need to Know if it is Sun, Mon.. or Friday. And I don't mind if it shows only with 3 caracters o completly.
Do you understand me?

SETLOCAL ENABLEEXTENSIONS
FOR /F "tokens=1,2 delims= " %%A in ('ECHO %DATE%') DO (
set FULLDATE=%%B
set DOW=%%A
)if "%FULLDATE%"=="" (
goto GB
) else (
goto US
):US
For /f "tokens=1-7 delims=:/-, " %%i in ('echo exit^|cmd /q /k"prompt $D $T"') do (
For /f "tokens=2-4 delims=/-,() skip=1" %%a in ('echo.^|date') do (
set dow=%%i
set %%a=%%j
set %%b=%%k
set %%c=%%l
set hh=%%m
set min=%%n
set ss=%%o
)
)goto end
:GB
For /f "tokens=1-6 delims=:/-, " %%i in ('echo exit^|cmd /q /k"prompt $D $T"') do (
For /f "tokens=2-4 delims=/-,() skip=1" %%a in ('echo.^|date') do (
set %%a=%%i
set %%b=%%j
set %%c=%%k
set hh=%%l
set min=%%m
set ss=%%n
)
)

thanks David. But I need de day of week, not de number of the day of the month.
The comand date takes de output: dd/mm/yyyy. And I would Know if today is Wensday or Friday, or Saturday.Don't mind. I ask to my boss.

This will get the day of the week from BIOS, regardless of language, region or anything else.
==============================
@echo off > d.d>> d.d echo E 0100 B4 2A CD 21 B4 4C CD 21
>> d.d echo N getdow.COM
>> d.d echo RCX
>> d.d echo 8
>> d.d echo W
>> d.d echo Qdebug < d.d > nul
del d.dgetdow
if errorlevel 0 set day=Sunday
if errorlevel 1 set day=Monday
if errorlevel 2 set day=Tuesday
if errorlevel 3 set day=Wednesday
if errorlevel 4 set day=Thursday
if errorlevel 5 set day=Friday
if errorlevel 6 set day=Saturday
echo today is %day%
del getdow.com
=====================================
If at first you don't succeed, you're about average.M2

Day of week is available in some locales and not other. You can set your locale through the control panel. Have a look at the variable %dow% that is getting set in the US section.
%dow% day of the week ie Wed
%mm% month
%dd% day of the month
%yy% 4 digit year
%hh% hour
%min% minute
%sec% second

![]() |
![]() |
![]() |

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