Sign in with
Sign up | Sign in
Your question

Batch File Disk Backup utility

Tags:
  • Backup
  • Hard Drives
Last response: in General UK & Ireland Discussions
Share
June 3, 2011 1:52:25 PM

hello i am making a batch file that backs up CDs to a certain hdd on my pc as its just a spare i have (40GB MAXTOR) and i want the thing to create a foldckuper i specifyon the drive for that certain backup using the XCOPY command

now here is the batch i have so far but i am not sure on how to code the folder option

@echo off
Mode Con Cols=45 Lines=1
XCOPY F:\ C:\CD1\ /E
exit

Now then i want the batch to allow me to tell it instead of "CD1" have whatever i type as the folder name but how do i do it?

i think you would use something like:

set /p web=Select Folder To Backup to:
if "%web%"=="...

More about : batch file disk backup utility

June 3, 2011 2:23:13 PM

i just found out by myself lol. it is:

@echo off
:start
echo =========================
echo 1)--[ Backup A Disk ]--(
echo 2)--[ Move a File to the Disk ]--(
echo =========================
set /p Option=Select Option:
if "%Option%"=="1" goto Backup
if "%Option%"=="2" goto Restore
Goto start
:restore
set /p Folder=Select Folder:
Xcopy C:\%Folder%\ F:\ /E
goto Start
:Backup
set /p Folder=Select Folder:
CLS
Xcopy F:\ C:\%Folder%\ /E
goto Start
!