Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 41,695 of 42,547    |
|    Herbert Kleebauer to pyotr filipivich    |
|    Re: I want to test: if a file date is "t    |
|    28 Feb 19 19:11:22    |
   
   From: klee@unibwm.de   
      
   On 28.02.2019 17:45, pyotr filipivich wrote:   
   > DIR ntuser.dat > Net-Date.txt   
   > works.   
   > FIND "02/18" net-date.txt   
   > works as well.   
   >   
   > And Errorlevel tells me if 02/18 is found or not.   
   >   
   > Now all I need to do is work out how to get today's date into a   
   > format to use as a search term.   
      
   Just create a temporary file to get today's date   
   in the same date format as you get for ntuser.dat:   
      
      
   for %%i in (ntuser.dat) do set d1=%%~ti   
   for /f "tokens=1" %%i in ("%d1%") do set d1=%%i   
      
   echo a>_.tmp   
   for %%i in (_.tmp) do set d2=%%~ti   
   for /f "tokens=1" %%i in ("%d2%") do set d2=%%i   
   del _.tmp   
      
   if %d1%==%d2% echo ntuser.dat has current date   
      
      
      
   But are you really sure ntuser.dat has the date of the last   
   login? My ntuser.dat has yesterdays date, but I started   
   the PC this morning.   
      
   --- 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