b

Posted on April 10, 2010, 9:08 pm UTC anonymously (about 1 year ago)

Code (highlighted for Text)

  1. @echo off
  2. cls
  3. echo Checking for changes in the folder %1%
  4.  
  5. setlocal enabledelayedexpansion
  6.  
  7. set firsttime=0
  8. :start
  9.  
  10. cd c:\
  11. dir %1% > temp
  12.  
  13. for %%R in (c:\temp) do (
  14.  
  15.         echo %%~zR > size
  16.  
  17.         if not %%~zR == !currentline! (
  18.                 if %firsttime%==1 (
  19.                         type c:\sound
  20.                         type c:\sound
  21.                         type c:\sound
  22.                 )
  23.         )
  24.        
  25.         set firsttime=1
  26.  
  27.         for /f %%a in (c:\size) do (
  28.                 set currentline=%%a
  29.         )
  30.  
  31. )
  32. rem
  33. goto start