New Posts  All Forums:Forum Nav:

Backup BAT

post #1 of 4
Thread Starter 
I'm trying to create a BAT file that backs up several folders to another drive (external or internal).

The requirements are:

1. Must backup one folder then backup another folder once it's completed in a queue process.
2. I want it to overwrite files in that folder if needed to without prompting
3. I want it to be done in a single BAT file.
4. If possible also to implement an Time Remaining / Progress indicator.
post #2 of 4
You want to use Xcopy with /Y switch. Not sure how the queue works or if there is going to be a progress indicator but it's going to get the job done. Why does it have to be a bat file anyway? You could try something like teracopy or similar programs.
Beast
(14 items)
 
Dell XPS Faptop
(8 items)
 
Alura :)
(11 items)
 
CPUMotherboardGraphicsRAM
i7 4790k Asus Z97 Pro WIFI-AC Sapphire Nitro Radeon R9 Fury Tri-X OC+  G.Skill 4 x 8GB F3-2133C9D-16GXH 
Hard DriveOptical DriveCoolingOS
2 x Intel 730 480GB SSD in RAID 0 Asus DRW-24B1ST/BLK/B/AS Noctua NH-D15 Winblows 10 Pro x64 
MonitorKeyboardPowerCase
Pixio PX277 Logitech G510 Seasonic SS-660XP2 Fractal Design R4 Blackout 
MouseMouse Pad
Logitech G500 Xtrac Ripper 
CPUMotherboardGraphicsRAM
Core 2 Duo T5250 @ 1.5ghz Dell 0N6705 Mobile Intel 965 Express 2 x 2GB Hyundai/Kingston DDR2 533mhz 
Hard DriveOptical DriveOSMonitor
OCZ Summit 60GB SSD Slot Load DVD-RW Windows 7 Ultimate x64 13.3 inch 1280x800 
CPUMotherboardGraphicsRAM
i5 2500k Asus P8Z68-V Pro MSI R7970 Lightning BE 2 x 4GB G.Skill Ripjaws 2133mhz 
Hard DriveOptical DriveCoolingOS
Mushkin Enhanced Chronos 240GB and WD Black 1TB Asus DRW-24B1ST Cooler Master Hyper 212 EVO Windows 7 Ultimate x64 
MonitorPowerCase
Hannspree 24 inch Thermaltake Tough Power TP-750P 750W Gold Cooler Master HAF 932 
  hide details  
Reply
Beast
(14 items)
 
Dell XPS Faptop
(8 items)
 
Alura :)
(11 items)
 
CPUMotherboardGraphicsRAM
i7 4790k Asus Z97 Pro WIFI-AC Sapphire Nitro Radeon R9 Fury Tri-X OC+  G.Skill 4 x 8GB F3-2133C9D-16GXH 
Hard DriveOptical DriveCoolingOS
2 x Intel 730 480GB SSD in RAID 0 Asus DRW-24B1ST/BLK/B/AS Noctua NH-D15 Winblows 10 Pro x64 
MonitorKeyboardPowerCase
Pixio PX277 Logitech G510 Seasonic SS-660XP2 Fractal Design R4 Blackout 
MouseMouse Pad
Logitech G500 Xtrac Ripper 
CPUMotherboardGraphicsRAM
Core 2 Duo T5250 @ 1.5ghz Dell 0N6705 Mobile Intel 965 Express 2 x 2GB Hyundai/Kingston DDR2 533mhz 
Hard DriveOptical DriveOSMonitor
OCZ Summit 60GB SSD Slot Load DVD-RW Windows 7 Ultimate x64 13.3 inch 1280x800 
CPUMotherboardGraphicsRAM
i5 2500k Asus P8Z68-V Pro MSI R7970 Lightning BE 2 x 4GB G.Skill Ripjaws 2133mhz 
Hard DriveOptical DriveCoolingOS
Mushkin Enhanced Chronos 240GB and WD Black 1TB Asus DRW-24B1ST Cooler Master Hyper 212 EVO Windows 7 Ultimate x64 
MonitorPowerCase
Hannspree 24 inch Thermaltake Tough Power TP-750P 750W Gold Cooler Master HAF 932 
  hide details  
Reply
post #3 of 4
Thread Starter 
Quote:
Originally Posted by Dopamin3 View Post

You want to use Xcopy with /Y switch. Not sure how the queue works or if there is going to be a progress indicator but it's going to get the job done. Why does it have to be a bat file anyway? You could try something like teracopy or similar programs.

I've been working on revising and testing the code and I've come down to the following snippet of code that accomplishes the objectives above:
Code:
xcopy "C:\BackupSource" "C:\BackupDestination" /c /d /e /h /i /k /q /r /s /x /y /v

Note: Script must be run with Administrator Privileges (Elevation) otherwise it will produce Access Denied due to one of the switches that mimics the /o option.

Edit: Revised Script:
Code:
xcopy "C:\BackupSource" "C:\BackupDestination" /c /d /e /h /i /k /q /r /s /x /y /w /j /f

Edited by 45nm - 4/28/12 at 7:46am
post #4 of 4
I would recommend Robocopy over Xcopy, it's more robust and has more features.

Cheers,
Jakob
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming