WMI batch script to obtain literal and numeric day of week

jcgriff2

Co-Founder / Admin
BSOD Instructor/Expert
Microsoft MVP (Ret.)
Staff member
Joined
Feb 19, 2012
Posts
21,541
Location
New Jersey Shore
A simple WMI batch script to obtain literal and numeric day of week -

Code:
[FONT=Lucida Console]
@echo off  
set daysofweek=Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday  
for /F "skip=2 tokens=2-4 delims=," %%A in ('WMIC Path Win32_LocalTime Get DayOfWeek /Format:csv') do set daynumber=%%A  
for /F "tokens=%daynumber% delims=," %%B in ("%daysofweek%") do set day=%%B
echo %daynumber% > c:\0  & echo %day% >> c:\0 & start notepad c:\0

[/FONT]

A Notepad will open with the day #; next line = Day of the week.

Batch file - http://sysnative.com/0x8/wmi_dayofweek_nameofday_jcgriff2_.bat.zip


http://www.techsupportforum.com/for...-moved-from-vista-7-a-565632.html#post3217395

Thanks. . .

John
 

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top