Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,666 of 68,980    |
|    mokomoji to All    |
|    Re: System Time    |
|    07 Nov 20 18:19:44    |
   
   From: mokomoji@naver.com   
      
   2020년 11월 7일 토요일 오전 2시 37분 26초 UTC+9에 Zaidy036님이   
   작성한 내용:   
   > In a batch we use %Time% to find the current system time.    
   >    
   > I am using NirSoft\runasdate-x64\RunAsDate.exe to run a batch but then    
   > time is "frozen" and I still want to read the system time.    
   >    
   > Any suggestions to directly retrieve the system time or have batch    
   > commands to run its own timer function independent of the system time?   
      
   Sorry.. mistake in source.   
      
   [code]   
      
      
   @echo off   
   cd /d "%~dp0"   
   setlocal   
   rem chcp 437   
   title=time.windows.com NTP server use date/time   
   echo [auto country word type]   
   chcp|find "437" 2>nul>nul&&(   
   set "z_time.pm=PM"   
   set "z_time.s_Capital=seoul"   
   set "z_time.n_Capital=pyongyang"   
   set "z_time.ment_head=Time is now"   
   set "z_time.ment_poot=a clack"   
   )   
   chcp|find "949" 2>nul>nul&&(   
   set "z_time.pm=오후"   
   set "z_time.s_Capital=서울"   
   set "z_time.n_Capital=평양"   
   set "z_time.ment_head=지금 시각은?"   
   set "z_time.ment_poot=입니다."   
   )   
   echo    
   for /f "delims=" %%f in ('tzutil /l') do (   
   echo "%%f"|findstr /i "(UTC\+[0][0]:[0][0])"   
   echo "%%f"|find /i "%z_time.s_Capital%"   
   echo "%%f"|find /i /v "태평양"|find /i "%z_time.n_Capital%"   
   )   
   echo AM/PM TYPE %z_time.pm%   
   for /f "skip=2 tokens=4,5,6,7,8,9 delims=:- " %%f in (   
   'w32tm /stripchart /computer:time.windows.com /samples:1'   
   ) do (   
   call set z_hour=%%j   
   if /i "%%i" equ "%z_time.pm%" call set /a z_hour=%%j+12   
   if "%%j" lss "10" call set z_hour=0%%j   
   echo "%%f-%%g-%%h"|findstr "20[0-9][0-9]-[0-1][0-9]-[0-3]" 2>nul>nul&&call set   
   "z_reardate=%%f-%%g-%%h"   
   call echo "%%z_hour%%:%%k"|findstr "[0-2][0-9]:[0-5][0-9]" 2>nul>nul&&call set   
   "z_reartime=%%z_hour%%:%%k"   
      
   )   
   echo    
   echo republic of s.korea   
   echo date %z_reardate%   
   echo time %z_reartime%   
   echo CreateObject^("SAPI.spvoice"^).Speak"%z_time.ment_head% %z_time.pm%   
   %z_reartime% %z_time.ment_poot%">speack.vbs   
   call speack.vbs&&del speack.vbs   
   echo    
   :end   
   endlocal   
   pause   
      
   [code]   
      
   voice&sound add on..~!!   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca