Backup (Favs, OE Mail/Address Book, and My Documents dir) One Click!!

Discuss anything not covered in another forum (life, the universe etc.)... Please keep it PG-13 and avoid spam.
Post Reply
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Backup (Favs, OE Mail/Address Book, and My Documents dir) One Click!!

Post by Norm »

For Windows XP
Here's my own way of backing up these important folders in XP.
It' was worth the five minutes to write it out.

Use Notepad to paste the following lines into, and save as backup.bat, or backup.cmd (or anything you like with either a .bat, or a .cmd extension.

Take note of the red y 's
Change all the red y 's to whatever drive letter you want to use for YOUR backups.

The batch file makes a folder named 'mybackup', and then makes 4 folders in there for each of the 'Favs, Docs, Contacts, and Emails.

Once you make the batch file, put it out of the way somewhere (the root of C:, or Program Files dir works well). Make a shortcut to it, and drop the shortcut in your quicklaunch.
Or if you like, schedule a task to run that batch every day.

Click the file manually, and watch it do it's thing. :)



@echo off
if exist y:\mybackup goto doit
md y:\MyBackup
md y:\mybackup\docs
md y:\mybackup\favs
md y:\mybackup\contacts
md y:\mybackup\oebackup
:doit
xcopy /s /e /h /y "%USERPROFILE%\My Documents" y:\mybackup\docs
xcopy /s /e /h /y "%USERPROFILE%\Favorites" y:\mybackup\favs
xcopy /s /e /h /y "%USERPROFILE%\Application Data\Microsoft\Address Book" y:\mybackup\contacts
xcopy /s /e /h /y "%USERPROFILE%\Local Settings\Application Data\Identities" y:\mybackup\oebackup
User avatar
EvilAngel
Posts: 18950
Joined: Thu Oct 19, 2000 12:00 am
Location: Garden Grove

Post by EvilAngel »

holy crap... thanks Norm! The answer to all my backup woes.

Thanks a million!
The Devil wrote:Tolerance is a virtue, not a requirement.
SG Theme Song
User avatar
EvilAngel
Posts: 18950
Joined: Thu Oct 19, 2000 12:00 am
Location: Garden Grove

Post by EvilAngel »

Just ran the BAT... Incredible.

You should make money with stuff like that.
The Devil wrote:Tolerance is a virtue, not a requirement.
SG Theme Song
Brk
SG VIP
Posts: 29518
Joined: Sun Dec 09, 2001 12:00 pm

Post by Brk »

Or just have it all on a separate partition.
User avatar
SeedOfChaos
Posts: 8651
Joined: Sat Apr 22, 2000 12:00 am
Location: Comfortably Numb

Post by SeedOfChaos »

Yeah, I have my email on D: to begin with, not my system partition C:. You can change the storage location of your email to whatever you want by going to Tools->Options, then go to the Maintenance tab and click on the "store location" button to pick a different folder. You may want to copy your existing folder files to that location first though. You can easily extract the files by using Norm's batch file. For the rest, your solution still rocks though Norm.
ex-WoW-addict
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Experienced users know a few different ways to essentially do what the batch file does. I posted this for those who use the system defaults, and don't know where these files are actually kept on the drive. It's a one click, easy way to save everything to one folder.

How often have you seen someone post "how do I backup my emails?"
or "address book" ?
Not just Burke, many others as well.
User avatar
mountainman
SG VIP
Posts: 15451
Joined: Tue Dec 26, 2000 12:00 am
Location: Colorado

Post by mountainman »

Wow.

That is really awesome! I know many a folk who will love this.

Need a job, Norm?

;)
User avatar
Ken
Posts: 12191
Joined: Wed Dec 31, 1969 7:00 pm
Location: Tampa

Post by Ken »

Once again, you come through, Normy! :)

This should work for 2k as well, no...


Guys, this is an example of a thread that you given mad props, kudos and some raw rep. to! ;) So get to clickin' on the lil scale icon below Normy's av, and show da brutha sum luv! :)
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Yep, it works the same in 2K Ken.
I just rebooted into 2K and tried it to be sure.

Note: All files with the same name get overwritten on each execution.

@Mountainman
I'd love a job where I could sit here and make a living. If you have one, let me know :)
Otherwise, I've got work coming out my ying yang. A lot of it involves labor, and I'm getting tired of being sore everyday.

My fingers don't get sore :D
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Here's an updated 'clear your cache' batch file.
XP only (2K doesn't use the 'taskkill' command (gotta find another way, but I rarely use 2K now)

taskkill /im iexplore.exe /f
taskkill /im wmiprvse.exe /f
taskkill /im explorer.exe /f
taskkill /im msmsgs.exe /f
RD /S/q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /S/q "%USERPROFILE%\Cookies"
RD /S/q "%USERPROFILE%\Local Settings\History"
attrib -r -a -s -h "%USERPROFILE%\Recent" /s /d
del /f /s /q "%USERPROFILE%\Recent\*.*"
start explorer.exe
pause

Clears all cookies, IE history, IE temp files, and recent docs
Kills a few tasks that get in the way (files in use) then restarts explorer.
User avatar
EvilAngel
Posts: 18950
Joined: Thu Oct 19, 2000 12:00 am
Location: Garden Grove

Post by EvilAngel »

Norm wrote:Here's an updated 'clear your cache' batch file.
XP only (2K doesn't use the 'taskkill' command (gotta find another way, but I rarely use 2K now)

taskkill /im iexplore.exe /f
taskkill /im wmiprvse.exe /f
taskkill /im explorer.exe /f
taskkill /im msmsgs.exe /f
RD /S/q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /S/q "%USERPROFILE%\Cookies"
RD /S/q "%USERPROFILE%\Local Settings\History"
attrib -r -a -s -h "%USERPROFILE%\Recent" /s /d
del /f /s /q "%USERPROFILE%\Recent\*.*"
start explorer.exe
pause

Clears all cookies, IE history, IE temp files, and recent docs
Kills a few tasks that get in the way (files in use) then restarts explorer.

That worked great too! Thanks Norm.


I cannot believe that you haven't got 1000 replies and thank yous...
The Devil wrote:Tolerance is a virtue, not a requirement.
SG Theme Song
User avatar
mountainman
SG VIP
Posts: 15451
Joined: Tue Dec 26, 2000 12:00 am
Location: Colorado

Post by mountainman »

I'll keep posting until there are 1000 replies. He deserves them.

+1
User avatar
Cypher
Posts: 2717
Joined: Tue Jul 02, 2002 12:00 pm
Location: Returning video tapes

Post by Cypher »

Norm wrote:Here's an updated 'clear your cache' batch file.
XP only (2K doesn't use the 'taskkill' command (gotta find another way, but I rarely use 2K now)

taskkill /im iexplore.exe /f
taskkill /im wmiprvse.exe /f
taskkill /im explorer.exe /f
taskkill /im msmsgs.exe /f
RD /S/q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /S/q "%USERPROFILE%\Cookies"
RD /S/q "%USERPROFILE%\Local Settings\History"
attrib -r -a -s -h "%USERPROFILE%\Recent" /s /d
del /f /s /q "%USERPROFILE%\Recent\*.*"
start explorer.exe
pause

Clears all cookies, IE history, IE temp files, and recent docs
Kills a few tasks that get in the way (files in use) then restarts explorer.
Thanks Norm. :D It works perfectly. :thumb:
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

EvilAngel wrote:That worked great too! Thanks Norm.


I cannot believe that you haven't got 1000 replies and thank yous...
You're welcome, everyone is welcome whether they reply or thank me or not.

I got over the lack of thanks a while ago. I help for my own reasons. Thanks is what respectable people with manners give, others have thier own problems, and I can,t help with that, only love them, and forgive them for they know not what they do :)
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Note: There will be times that the "clearcache" batch doesn't clear everything as planned. Some files stay in use, and are locked by other processes. Usually if you run the batch file again, it will clear everything the second time.
I think it's because there is not enough of a time delay between killing the processes, and clearing the files. Not sure.
User avatar
EvilAngel
Posts: 18950
Joined: Thu Oct 19, 2000 12:00 am
Location: Garden Grove

Post by EvilAngel »

Norm wrote:Note: There will be times that the "clearcache" batch doesn't clear everything as planned. Some files stay in use, and are locked by other processes. Usually if you run the batch file again, it will clear everything the second time.
I think it's because there is not enough of a time delay between killing the processes, and clearing the files. Not sure.

Is it possible to remove the cookies command and have the bat still work effectivly?
I hate my cookies to be cleared sometimes. TIA
The Devil wrote:Tolerance is a virtue, not a requirement.
SG Theme Song
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

EvilAngel wrote:Is it possible to remove the cookies command and have the bat still work effectivly?
I hate my cookies to be cleared sometimes. TIA
No problem, just delete this line

RD /S/q "%USERPROFILE%\Cookies"
User avatar
EvilAngel
Posts: 18950
Joined: Thu Oct 19, 2000 12:00 am
Location: Garden Grove

Post by EvilAngel »

Norm wrote:No problem, just delete this line

RD /S/q "%USERPROFILE%\Cookies"

Awesome! If you had reps enabled I'd give ya one ;) :p
The Devil wrote:Tolerance is a virtue, not a requirement.
SG Theme Song
User avatar
brembo
Posts: 18725
Joined: Tue Mar 20, 2001 12:00 am
Location: crawlspaces

Post by brembo »

The batch for the clearing of IE stuff killed explorer(as it should), but then just sat there. I had to log out of the session and log back in, what am I doin wrong?
Tao_Jones Cult Member since 2004
I gave Miss Manners a Dirty Sanchez, and she LIKED it.
User avatar
Roody
SG VIP
Posts: 30735
Joined: Sun Nov 19, 2000 12:00 am
Location: East Tennessee

Post by Roody »

Norm wrote:For Windows XP
Here's my own way of backing up these important folders in XP.
It' was worth the five minutes to write it out.

Use Notepad to paste the following lines into, and save as backup.bat, or backup.cmd (or anything you like with either a .bat, or a .cmd extension.

Take note of the red y 's
Change all the red y 's to whatever drive letter you want to use for YOUR backups.

The batch file makes a folder named 'mybackup', and then makes 4 folders in there for each of the 'Favs, Docs, Contacts, and Emails.

Once you make the batch file, put it out of the way somewhere (the root of C:, or Program Files dir works well). Make a shortcut to it, and drop the shortcut in your quicklaunch.
Or if you like, schedule a task to run that batch every day.

Click the file manually, and watch it do it's thing. :)



@echo off
if exist y:\mybackup goto doit
md y:\MyBackup
md y:\mybackup\docs
md y:\mybackup\favs
md y:\mybackup\contacts
md y:\mybackup\oebackup
:doit
xcopy /s /e /h /y "%USERPROFILE%\My Documents" y:\mybackup\docs
xcopy /s /e /h /y "%USERPROFILE%\Favorites" y:\mybackup\favs
xcopy /s /e /h /y "%USERPROFILE%\Application Data\Microsoft\Address Book" y:\mybackup\contacts
xcopy /s /e /h /y "%USERPROFILE%\Local Settings\Application Data\Identities" y:\mybackup\oebackup

Nice one Norm. Tell me something. If I wanted to add Outlook to this also would the command be:

md y:\mybackup\outlook
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Roody wrote:Nice one Norm. Tell me something. If I wanted to add Outlook to this also would the command be:

md y:\mybackup\outlook
Yes, that line will make a dir named outlook in the mybackup dir.

You also need a line to copy the files there.
Let me know where your Outlook files (I believe they are .pst files) are and I'll customize a line for you.

Brembo, not sure why yours stopped. Must be an error. Anything there showing an error?
User avatar
brembo
Posts: 18725
Joined: Tue Mar 20, 2001 12:00 am
Location: crawlspaces

Post by brembo »

Nope, explorer just stopped dead. I could alt-tab and jump around the dos based folding routines and the various wordpad docs I had open, but no desktop. I did a soft reset with task manager and all was well.
Tao_Jones Cult Member since 2004
I gave Miss Manners a Dirty Sanchez, and she LIKED it.
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Hmm, might be "folding" gets in the way.
Anyone else folding and it works for them?
User avatar
zooner
Posts: 8839
Joined: Mon Oct 14, 2002 12:00 pm
Location: Buffalo, NY

Post by zooner »

awesome, thanks!!
Strap It On Whenever It Seems Appropriate

tomsclan.com
User avatar
Roody
SG VIP
Posts: 30735
Joined: Sun Nov 19, 2000 12:00 am
Location: East Tennessee

Post by Roody »

Norm wrote:Yes, that line will make a dir named outlook in the mybackup dir.

You also need a line to copy the files there.
Let me know where your Outlook files (I believe they are .pst files) are and I'll customize a line for you.

Brembo, not sure why yours stopped. Must be an error. Anything there showing an error?
Well I can put them wherever on my F drive. For simplicity sake I will go ahead and put them in the same directory you mention in your example.
User avatar
EvilAngel
Posts: 18950
Joined: Thu Oct 19, 2000 12:00 am
Location: Garden Grove

Post by EvilAngel »

Roody wrote:Well I can put them wherever on my F drive. For simplicity sake I will go ahead and put them in the same directory you mention in your example.

I think you'll need to put them on a partition. Do you have a Y partition or drive?

I could be wrong but that's how I understood it.
The Devil wrote:Tolerance is a virtue, not a requirement.
SG Theme Song
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

I'm sorry, but I just don't have time for everything guys. If you read my instructions, you'll get it right.

I have a Y drive, you may not, that's why I instructed to change the red Y's to whatever drive (or partition) that YOU actually have. It could be C, D, E, F etc etc etc.
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Here's everything in one batch file.
I call it gnight.bat
For XP only

First the backups are made, then kills IE, Explorer, MSN, OE, then the cache is cleared (twice, just to be sure) then my IP is released, then finally, my computer is locked up.(goes to the logon screen)
Again, don't forget to change the red Y's to a drive letter that is actually on YOUR machine (a partition, or a drive)


@echo off
if exist y:\mybackup goto doit
md y:\MyBackup
md y:\mybackup\docs
md y:\mybackup\favs
md y:\mybackup\contacts
md y:\mybackup\oebackup
:doit
xcopy /s /e /h /y "%USERPROFILE%\My Documents" y:\mybackup\docs
xcopy /s /e /h /y "%USERPROFILE%\Favorites" y:\mybackup\favs
xcopy /s /e /h /y "%USERPROFILE%\Application Data\Microsoft\Address Book" y:\mybackup\contacts
xcopy /s /e /h /y "%USERPROFILE%\Local Settings\Application Data\Identities" y:\mybackup\oebackup[/QUOTE]
taskkill /im iexplore.exe /f
taskkill /im wmiprvse.exe /f
taskkill /im explorer.exe /f
taskkill /im msmsgs.exe /f
taskkill /im msimn.exe /f
RD /S/q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /S/q "%USERPROFILE%\Cookies"
RD /S/q "%USERPROFILE%\Local Settings\History"
attrib -r -a -s -h "%USERPROFILE%\Recent" /s /d
del /f /s /q "%USERPROFILE%\Recent\*.*"
taskkill /im iexplore.exe /f
taskkill /im wmiprvse.exe /f
taskkill /im explorer.exe /f
taskkill /im msmsgs.exe /f
taskkill /im msimn.exe /f
RD /S/q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /S/q "%USERPROFILE%\Cookies"
RD /S/q "%USERPROFILE%\Local Settings\History"
attrib -r -a -s -h "%USERPROFILE%\Recent" /s /d
del /f /s /q "%USERPROFILE%\Recent\*.*"
start explorer.exe
ipconfig /release
%windir%\System32\rundll32.exe user32.dll,LockWorkStation

Note: When you log back in, don't forget you'll have to renew your IP before you can go online.

Start>run>ipconfig /renew
For now.
I'll make up a gday.bat soon :)

P.S
The google spider was just in this thread, cool :)
qball15j
Senior Member
Posts: 3619
Joined: Mon Nov 26, 2001 9:28 pm

Post by qball15j »

Great work Norm, It's amazing how much I forgot a batch file can actually do... :)
User avatar
minir
Posts: 27941
Joined: Sat Aug 19, 2000 12:00 am
Location: Canada

Post by minir »

:) We LOVE YOU Norm :)


Thanks a Batch :thumb: :)


regards

minir
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

You're welcome guys, this is fun :)

For Roody (and anyone else using Outlook)

add this line after the lastline starting with "md ".
md y:\mybackup\outlook

add this line after the last line starting with "xcopy"
xcopy /s /e /h /y "%systemroot%\Application Data\microsoft\outlook y:\mybackup\outlook

Note: If you already have made a mybackup dir, rename it before running this new code. If you do not then the outlook files will not be copied.
User avatar
Ken
Posts: 12191
Joined: Wed Dec 31, 1969 7:00 pm
Location: Tampa

Post by Ken »

Ran across this thread doing some cleaning and thought it deserved a bump...

Thanks again Normy! :)
Post Reply