Page 1 of 1

My AT script...

Posted: 15 Jan 2017 15:55
by sklub

Code: Select all

@echo off
:AT
Rem Enter time
set AT=00:00
Rem Enter command
set DO=start cmd
:ClockMain
set time=%time%
if %time:~1,1%==: goto :timeA
if %time:~2,1%==: goto :timeB
goto :ClockMain
:timeA
set A=0
set B=%time:~0,1%
set C=%time:~2,1%
set D=%time:~3,1%
goto :DoAt
:timeB
set A=%time:~0,1%
set B=%time:~1,1%
set C=%time:~3,1%
set D=%time:~4,1%
goto :DoAt
:DoAt
set Mytime=%A%%B%:%C%%D%
if %Mytime%==%AT% %DO%
echo %Mytime% %AT%
timeout /t 1 > null.txt
del null.txt
cls
Goto :ClockMain

Re: My AT script...

Posted: 15 Jan 2017 21:21
by Squashman

Code: Select all

@echo off
:AT
Rem Enter time
set AT=00:00
Rem Enter command
set DO=start cmd
:ClockMain
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set Mytime=%dt:~8,2%:%dt:~10,2%
if %Mytime%==%AT% %DO%
echo %Mytime% %AT%
timeout /t 1 >nul
cls
Goto ClockMain

Re: My AT script...

Posted: 15 Jan 2017 21:23
by ShadowThief
AT is deprecated.