anchor.diff: +rem @echo off
  +setlocal
  +rem    
  +::       866 
  +for /f "tokens=2 delims=:" %%i in ('chcp') do (
  +    set PrevCP=%%i)
   rem   
  -rem @echo off
  -rem   
  -chcp 1251 >nul
  +chcp 1251 > nul
   rem  
  -goto start
  +goto Start
   --------------------------------------
      
      
  
positive.code:     .
  --------------------------------------
     19/01/2015
     23/01/2015
    
  --------------------------------------
  
      
  "     !"
       !
      !
  :start
  rem    1 
  set source=D:\1C\Base
  rem        
  set backup=E:\backup-1C
  rem    .
  set NumberArchives=1
  rem   
  set password=123
  
  rem  
  
  rem     WinRar
  ::     
  if exist "%PROGRAMFILES%\WinRAR\rar.exe" (set archive="%PROGRAMFILES%\WinRAR\rar.exe") else (if exist "%PROGRAMFILES(x86)%\WinRAR\rar.exe" (set archive="%PROGRAMFILES(x86)%\WinRAR\rar.exe") else (goto NoArchive))
  rem      ()
  set CurrentDisk="%~dp0"
  rem   (   ).
  set logfile=%CurrentDisk%\backup.log
  
  rem  
  rem %date%   ( ) 
  rem      
  if exist %backup%\%date%.rar (goto ExistBackup)
  rem     
  if not exist %source% (goto NoSourceDir)
  rem     
  if not exist %backup% (goto NoBackupDir)
  
  rem 
  rem     rar.exe
  
negative.code: :: -hp    -     
  :: -k     -   (  )
  :: --     -   
  %ArchiveProgram% a -cfg- -ma -htb -m5 -rr10p -ac -ow -agDD.MM.YYYY -ep1 -hp%Password% -k %PathScript% %Source% --
  
  rem  
  rem %ErrorLevel%   
  ::  rar.exe
  rem      
  ::         
  if %ErrorLevel%==0 (set Result="  "
  goto MoveArchive) else (set Result=" - %ErrorLevel%"
  goto Error)
  
  :MoveArchive
  rem      
  rem %DATE%   ( )
  rem       
  move %PathScript%\%DATE%.rar %Backup%
  rem        
  if exist %Backup%\%DATE%.rar (set Result="  ") else (set Result="  "
  goto Error)
  goto Log
  
  :NoArchiveProgram
  set Result="   "
  goto Error
  
  :NoSourceDir
  set Result="    "
  goto Error
  
  :NoBackupDir
  set Result="    "
  goto Error
  
  :ExistBackup
  set Result="    "
  goto Log
  
  :Error
  set Error=1
  
  :Log
  rem      
  rem %DATE%   ( )
  rem %TIME%   ( )
  rem %Result%  
  rem %LogFile%    
  rem %NumberStringsLog%   
  ::    
  rem "" http://www.cyberforum.ru/cmd-bat/thread1299615.html
  set "Logging=echo %DATE% %TIME% %Result% >> "%LogFile%""
  if exist "%LogFile%" (
   for /f %%i in ('"<"%LogFile%" find /c /v """') do (
    if %%i lss %NumberStringsLog% (
     %Logging%
    ) else (
     <"%LogFile%" more +1>.tmp
     >"%LogFile%" type .tmp
     del .tmp
     %Logging%
     )
    )
  ) else (
   %Logging%
   )
  
  rem       
  ::     
  ::  /a /y    
  ::   
  copy /a /y %LogFile% %Backup%
  
  rem   
  rem      
  ::     
  rem forfiles -    
  :: /P %Backup% -      
  :: %DATE%   ( )
  :: /M *.rar -   rar
  :: /D -%NumberArchives% -     
  :: /C "cmd /c del /q @PATH" -   
  if exist %Backup%%DATE%.rar (forfiles /P %Backup% /M *.rar /D -%NumberArchives% /C "cmd /c del /q @PATH")
  
  rem    
  ::     
  ::     
  if %Error%==1 (color 0c
  echo %Result%
  pause)
  
  rem  
  :: (     
  ::  )
  color 07
  chcp %PrevCP% >nul
  endlocal
  rem exit
  
  