Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Get the day of the week (e.g. Monday, Tuesday, etc.)
- for /f %%i in ('powershell -NoProfile -Command "(Get-Date).DayOfWeek"') do set DayOfWeek=%%i
- :: Define the paths
- set "Source=C:\FolderToBackup"
- set "BackupDestination=C:\Backup\%DayOfWeek%"
- :: Perform the backup with Robocopy
- robocopy "%Source%" "%BackupDestination%" /MIR
- Pause
Advertisement
Add Comment
Please, Sign In to add comment