Archiv

Archiv für die Kategorie ‘DOS’

Tages-Backup per RoboCopy

15. November 2012 Keine Kommentare

@ECHO OFF
set WOCHENTAG=

for /f %%g in ('wmic path win32_localtime get dayofweek^|findstr /v /r "^$"') do (
    set WOCHENTAG=%%g
)
 
if %WOCHENTAG%==1 set WOCHENTAG=Montag
if %WOCHENTAG%==2 set WOCHENTAG=Dienstag
if %WOCHENTAG%==3 set WOCHENTAG=Mittwoch
if %WOCHENTAG%==4 set WOCHENTAG=Donnerstag
if %WOCHENTAG%==5 set WOCHENTAG=Freitag
if %WOCHENTAG%==6 set WOCHENTAG=Samstag
if %WOCHENTAG%==7 set WOCHENTAG=Sonntag

robocopy.exe "C:\Quelle" X:\ZIEL\%WOCHENTAG% /E /ZB /mir /COPY:DAT /R:0 /W:0
 

KategorienAllgemein, DOS