Jump to content


Creating a batch file for backing up files and folders on XP?


8 replies to this topic

#1 OFFLINE   Robbie

    Advanced Member

  • Members
  • PipPipPip
  • 318 posts
  • Gender:Male
  • Location:Newcastle, UK

Posted 01 April 2008 - 11:41 PM

I wonder if this is possible...

I'm running XP

Every night I back up several files / folders I have on my computer, none of them massive files, mainly things like Microsoft Money file, Works Folder (for things like calendar etc). The files I back up are pretty much a constant and I back them up to a folder in My Documents called Backup which I then backup to a USB Flash Drive. However it's a nuisance having to go around to various parts of my computer to right click and use the Send To feature to back up each of these files (I have a Send To: Backup in that right click dialog box). It only takes a few minutes but I'd like to be able to backup in one go...

What I would like is something like a batch file where I could just run that and it would then automatically run a backup of all of the various files and folders I backup. I would like them sent to the Backup folder on the computer and I could then copy that to the flash drive.

Is this possible? If it is, how do I create one?

Thanks!

#2 OFFLINE   Andavari

    Captain Spectacular

  • Moderators
  • 13,330 posts
  • Gender:Male
  • Location:Shadow Moses

Posted 02 April 2008 - 12:57 AM

It's possible!!! ;)

I use a batch file and the command line version of 7-zip to make the whole process semi-automatted, the only user interaction I have is to hit the Enter key on the keyboard a couple of times, and to insert a CD-RW to burn a backup. What would take me I suppose up to an hour (maybe longer) to do manually gets done in about three minutes from start to finish for the batch file, plus an extra two minutes to burn a CD-RW backup.

Note that it's wise to recreate the folder structure so it's as simple as copying to C: and selecting Paste to restore files.

What you need to do:
ECHO [ COPYING ALL USERS PROFILE FILES AND FOLDERS ]
ECHO.

XCOPY /I /E /V /R /Y "%AllUsersProfile%\DRM" "D:\My Backups\Documents and Settings\All Users\DRM"
XCOPY /I /E /V /R /Y "%AllUsersProfile%\Start Menu" "D:\My Backups\Documents and Settings\All Users\Start Menu"

ECHO.
ECHO --------------------------------------------------------------------------
ECHO.

ECHO [ COPYING MY USER PROFILE NAME USER PROFILE FILES AND FOLDERS ]
ECHO.

XCOPY /I /V /R /Y "%appdata%\Microsoft\Internet Explorer\Quick Launch" "D:\My Backups\Documents and Settings\My User Profile Name\Application Data\Microsoft\Internet Explorer\Quick Launch"
XCOPY /I /E /V /R /Y "%UserProfile%\Desktop" "D:\My Backups\Documents and Settings\My User Profile Name\Desktop"
XCOPY /I /E /V /R /Y "%UserProfile%\Favorites" "D:\My Backups\Documents and Settings\My User Profile Name\Favorites"
XCOPY /I /E /V /R /Y "%UserProfile%\My Documents" "D:\My Backups\Documents and Settings\My User Profile Name\My Documents"
XCOPY /I /E /V /R /Y "%UserProfile%\SendTo" "D:\My Backups\Documents and Settings\My User Profile Name\SendTo"
XCOPY /I /E /V /R /Y "%UserProfile%\Start Menu" "D:\My Backups\Documents and Settings\My User Profile Name\Start Menu"

ECHO.
ECHO --------------------------------------------------------------------------
ECHO.

ECHO [ COPYING WINDOWS DIRECTORY FILES AND FOLDERS ]
ECHO.

MD "D:\My Backups\Windows"
XCOPY /I /V /R /Y "%WinDir%\*.bat" "D:\My Backups\Windows"
XCOPY /I /V /R /Y "%WinDir%\cdplayer.ini" "D:\My Backups\Windows"
XCOPY /I /V /R /Y "%WinDir%\contig*" "D:\My Backups\Windows"
XCOPY /I /V /R /Y "%WinDir%\Meta*" "D:\My Backups\Windows"
XCOPY /I /V /R /Y "%WinDir%\regjump*" "D:\My Backups\Windows"
XCOPY /I /V /R /Y "%WinDir%\socketlock*" "D:\My Backups\Windows"
XCOPY /I /V /R /Y "%WinDir%\Tag*" "D:\My Backups\Windows"
MD "D:\My Backups\Windows\icons"
XCOPY /I /E /V /R /Y "%WinDir%\icons" "D:\My Backups\Windows\icons"


ECHO.
ECHO --------------------------------------------------------------------------
ECHO.

ECHO [ AVAST ANTI-VIRUS IS NOW SCANNING ALL FILES IN: D:\My Backups ]
ECHO.
"%ProgramFiles%\Alwil Software\Avast4\ashQuick.exe" "D:\My Backups\*"
ECHO.
ECHO.
PAUSE

ECHO.
ECHO --------------------------------------------------------------------------


ECHO [ CONTIG IS NOW DEFRAGMENTING ALL FILES IN: D:\My Backups ]
contig.exe -s "D:\My Backups"


ECHO.
ECHO --------------------------------------------------------------------------
ECHO.


ECHO [ 7-ZIP CLI IS NOW AUTOMATICALLY CREATING: D:\My Backups.7z ]
"%ProgramFiles%\7-Zip\7z.exe" a "D:\My Backups.7z" "D:\My Backups"


ECHO.
ECHO --------------------------------------------------------------------------
ECHO.


ECHO [ CONTIG IS NOW DEFRAGMENTING: D:\My Backups.7z ]
contig.exe "D:\My Backups.7z"


ECHO.
ECHO --------------------------------------------------------------------------
ECHO.


ECHO [ CREATE A BACKUP DISC WITH IMGBURN ]
"%ProgramFiles%\ImgBurn\ImgBurn.exe"

CLS
EXIT
Learning how to create a batch file to backup any and all files you want makes any and all downloadable backup software obsolete.
Complexity of incoherent design.

#3 OFFLINE   hazelnut

    try to stay calm

  • Moderators
  • 9,460 posts
  • Gender:Female
  • Location:Huddersfield uk

Posted 02 April 2008 - 12:14 PM

Robbie as an alternative to a batch file you could use Karen's Replicator available here

http://www.karenware...treplicator.asp

Once you have made your first copies, one click is all you need to backup your selected files.

Easy to use, reliable, and free.
CCLEANER, RECUVA, DEFRAGGLER AND SPECCY DOCUMENTATION CAN BE FOUND HERE

http://www.piriform.com/docs

#4 OFFLINE   YoKenny

    Super Power User

  • Members
  • PipPipPipPipPip
  • 2,874 posts
  • Gender:Male
  • Location:Oshawa, Ont. Canada
  • Interests:Helping people get rid of malware on their systems then showing them how not to get re-infected again

Posted 02 April 2008 - 04:24 PM

I like Karen's Power Tools and I use Computer Profiler, Countdown Timer II and WhoIs
"Education is what remains after one has forgotten everything he learned in school." - Albert Einstein
IE7Pro user

#5 OFFLINE   M. A. Kader

    Newbie

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Bangladesh
  • Interests:Discover it solution;Discover human goal.

Posted 08 December 2010 - 01:50 AM

{POST REMOVED FOR SPAM LIKE BEHAVIOR see moderator comment below}

#6 OFFLINE   Andavari

    Captain Spectacular

  • Moderators
  • 13,330 posts
  • Gender:Male
  • Location:Shadow Moses

Posted 08 December 2010 - 11:48 AM

View PostM. A. Kader, on 08 December 2010 - 01:50 AM, said:

The batch BackupMe is an automated user profile backing up solution for Windows.
We do have a thread dedicated to Freeware, instead of reviving an ancient over 2 years old topic.

You may also want to contact Dr.WEB anti-virus in Russia since their antivirus is "perhaps producing a false positive" against your program as a SCRIPT.Virus, according to this Jotti scan, however 18 other scanners say it's clean.
Complexity of incoherent design.

#7 OFFLINE   login123

    blanko

  • Members
  • PipPipPipPip
  • 1,778 posts
  • Gender:Not Telling

Posted 08 December 2010 - 11:59 AM

View PostM. A. Kader, on 08 December 2010 - 01:50 AM, said:

The batch BackupMe is an automated user profile backing up solution for Windows. ...

I tried it, it works without a reboot. Is bit complicated for me but it did back up "My documents", "Desktop", and "Favorites" to the designated partition: W:\.

Does not seem to have left a bunch of junk on the computer, can anyone confirm that?

I cannot try Karens, it requires restart & I can't do that just now.

Posted Image. . . .Posted Image

edit: To follow what Andavari said, Avast! and MBAM show the folder clean.

Edited by login123, 08 December 2010 - 12:08 PM.

The SLIM version is always released a bit after any new version; when it is it will be HERE :-)

#8 OFFLINE   Nergal

    Volunteer CCleaner Demon/Post Meddler

  • Moderators
  • 3,102 posts
  • Gender:Male
  • Interests:SmartPhones

Posted 08 December 2010 - 07:35 PM

Sorry Guys but the above post is copy paste spam
http://www.google.co...ex=&startPage=1

I have deleted the post and banned the user
ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION
DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.
Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)
ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.
CCLEANER, RECUVA, DEFRAGGLER AND SPECCY DOCUMENTATION CAN BE FOUND AT www.piriform.com/docs
Link to Winapp2.ini explaination

#9 OFFLINE   login123

    blanko

  • Members
  • PipPipPipPip
  • 1,778 posts
  • Gender:Not Telling

Posted 09 December 2010 - 02:06 AM

View PostNergal, on 08 December 2010 - 07:35 PM, said:

Sorry Guys but the above post is copy paste spam
.....
I have deleted the post and banned the user

Good catch....I guess. I didn't know it was spam, still not sure it is, tried the application and it worked pretty well, and is free. Only unusual thing I saw was a bunch of popups at while getting to the site. But for my part, you can delete the whole thread and save some disk space, wouldn't hurt my feelings. Don't want to lead members astray. :D
The SLIM version is always released a bit after any new version; when it is it will be HERE :-)