time - Batch: Trying to get a command to execute at a specific amount of seconds -


this works hours, running in loop hits 13 hours executes.

@echo off  :time echo %time% /f "tokens=1*delims=0" %%a in ("$0%time:~0,2%") set /a hh=%%b if %hh% equ 13 goto success goto time  :success echo success pause goto time 

but if run seconds in loop execute @ 13 seconds keeps running in loop , doesn't execute command.

@echo off  :time echo %time% /f "tokens=1*delims=0" %%a in ("$0%time:~5,2%") set /a ss=%%b if %ss% equ 13 goto success goto time  :success echo success pause goto time 

this doesn't work either

for /f "tokens=1*delims=0" %%a in ("$0%time:~6,2%") set /a ss=%%b 

i need execute @ specified amount of seconds. instead of instance executing @ 13:00:00.00. can execute @ 13:00:13.00 or that.

needs 6 not 5 offset.

%time:~6,2% 

it not have complex. works, unless provide more details trying accomplish cannot provide best help.

:time echo %time% if %time:~6,2% equ 13 goto success goto time 

note using time environment variable user locale specific.

use no locale format time.

wmic path win32_operatingsystem localdatetime 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -