Batch for checking days and time -
i wrote batch check days , time execute particular actions.
for time use this:
for /f "tokens=1-3 delims=:" %%a in ("%time%") if %%a geq 7 if %%a leq 18 goto email
and works pretty good.
now ensure execute actions monday friday.
i think sentence can have number day (1 = monday , on...):
wmic path win32_localtime dayofweek
someone me combine them check time , day , action or not?
thanks help.
regards
as shown here, write:
@echo off set daysofweek=monday,tuesday,wednesday,thursday,friday,saturday,sunday /f "skip=2 tokens=2-4 delims=," %%a in ('wmic path win32_localtime dayofweek /format:csv') set daynumber=%%a /f "tokens=%daynumber% delims=," %%b in ("%daysofweek%") set day=%%b echo day number %daynumber% echo day %day%
(script copied http://www.sysnative.com/forums/windows-tips-tricks)
Comments
Post a Comment