Monday, 12 December 2016

DOS Command (CMS) Create Folder Current Datetime and Move Files Shared Folder

  1. @echo off    
  2. set hh=%time:~-11,2%    
  3. set /a hh=%hh%+100    
  4. set hh=%hh:~1%    
  5. set dateseed=%date:~10,4%%date:~4,2%%date:~7,2%_%hh%    
  6.     
  7. %time:~3,2%%time:~6,2%    
  8.     
  9. if not exist "\\140.175.165.10\Sharing\Databasebackup\    
  10.     
  11. %dateseed%" mkdir "\\140.175.165.10\Sharing    
  12.     
  13. \Databasebackup\%dateseed%"    
  14.     
  15. copy D:\HELLO "\\140.175.165.10\Sharing\Databasebackup\    
  16.     
  17. %dateseed%"   

No comments:

Post a Comment

Search text in stored procedure in SQL Server

SELECT *   FROM   sys.procedures WHERE  Object_definition(object_id) LIKE '%keyword%'