The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Operating Systems
> Windows Help
|
Batch file to backup all user profiles
Discuss Batch file to backup all user profiles in the Windows Help forum on Dev Shed. Batch file to backup all user profiles Windows Help forum discussing tips, tricks, configurations, and more. Microsoft Windows is one of the most popular operating systems due to its ease of use.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

June 18th, 2006, 08:01 PM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 7
Time spent in forums: 1 h 28 m 31 sec
Reputation Power: 0
|
|
|
Batch file to backup all user profiles
I was just wondering how i would make a batch file to backup all user acconts on diffrent computers.
I work on alot of computers and backup their user profiles data, outlook express, my documents, favorites, ect and I would like to have a batch file to automate this without having to know each username and edit the batch file each time. Any help would be great thanks.
|

June 19th, 2006, 07:20 AM
|
 |
|
|
Join Date: Jan 2004
Location: New Springfield, OH
|
|
Would it be easier for you to use a program such as Cobian Backup instead?
|

June 19th, 2006, 07:47 AM
|
 |
Periodically energetic Perler
|
|
Join Date: May 2005
Location: Dublin, Ireland
|
|
Quote: | Originally Posted by Xodus I was just wondering how i would make a batch file to backup all user acconts on diffrent computers.
I work on alot of computers and backup their user profiles data, outlook express, my documents, favorites, ect and I would like to have a batch file to automate this without having to know each username and edit the batch file each time. Any help would be great thanks. |
I dont know what network you have but having all the profiles on one machine would simplify the issue of backing all that up. Here's more info.
Displeaser
__________________
Vi Veri Veniversum Vivus Vici.
|

June 19th, 2006, 06:01 PM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 7
Time spent in forums: 1 h 28 m 31 sec
Reputation Power: 0
|
|
|
Well actually it's not a network, I'm in computer repair, and I see so many computers and do the data backup I just wanted to run a batch file to make it easier. I want to do it without installing a third party software. So hopefully thats a little clearer. I didn't really explain myself very well at first. Thanks.
|

June 19th, 2006, 06:22 PM
|
 |
|
|
Join Date: Jan 2004
Location: New Springfield, OH
|
|
|
How about a WSH script? You can easily get the currently logged on username and home directory from Environmental variables.
Batch is old-school and generally slower.
|

June 20th, 2006, 01:13 AM
|
 |
Providing fuel for space ships
|
|
Join Date: Mar 2004
Location: nr Edinburgh, Scotland
|
|
|
True, but in my eyes, batch files are a lot easier to create.
__________________
The No Ma'am commandments:
1.) It is O.K. to call hooters 'knockers' and sometimes snack trays
2.) It is wrong to be French
3.) It is O.K. to put all bad people in a giant meat grinder
4.) Lawyers, see rule 3
5.) It is O.K. to drive a gas guzzler if it helps you get babes
6.) Everyone should car pool but me
7.) Bring back the word 'stewardesses'
8.) Synchronized swimming is not a sport
9.) Mud wrestling is a sport
|

June 20th, 2006, 03:09 AM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 7
Time spent in forums: 1 h 28 m 31 sec
Reputation Power: 0
|
|
I like batch files myself but what ever scripting works better for this particular idea is cool. So Using this batch file below is there any way to backup all the users at once instead of going into each profile and then running the batch file. Maybe vbs and wsh can to that. As far as I can tell i don't think I can do it with a batch file. I thought maybe if I could use a batch file to display all the user profiles and then choose to backup all. Not sure if possible.
Quote: @echo off
:: variables
set drive=g:\Backup
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"
echo ### Backing up Favorites...
%backupcmd% "%USERPROFILE%\Favorites" "%drive%\Favorites"
echo ### Backing up email and address book (Outlook Express)...
%backupcmd% "%USERPROFILE%\Application Data\Microsoft\Address Book" "%drive%\Address Book"
%backupcmd% "%USERPROFILE%\Local Settings\Application Data\Identities" "%drive%\Outlook Express"
echo ### Backing up email and contacts (MS Outlook)...
%backupcmd% "%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook" "%drive%\Outlook" |
|

June 20th, 2006, 05:04 AM
|
 |
Periodically energetic Perler
|
|
Join Date: May 2005
Location: Dublin, Ireland
|
|
|
why not just backup everything in the "documents and settings" folder(at least in w2k), this will backup all the user profiles. I know this is a bit overkill but if simplicity is the requirement and disk space isnt an issue it would seem the easiest option.
Displeaser
|

June 20th, 2006, 05:07 PM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 7
Time spent in forums: 1 h 28 m 31 sec
Reputation Power: 0
|
|
|
Well this is an option I have thought of. It's simple to do backup but it becomes the same amoutn of work when sifting through the data and organizing it. Which is basically how I backp now. Just go to documents and settings and drag over the folders I want. Just trying to automate things is all. Thanks for the ideas so far though. Maybe a vbs script would have more functionalityto do this. Or maybe I'm just over thinking this.
|

June 20th, 2006, 05:51 PM
|
 |
|
|
Join Date: Jan 2004
Location: New Springfield, OH
|
|
Quote: | Originally Posted by Xodus Maybe a vbs script would have more functionalityto do this. Or maybe I'm just over thinking this. | That's where WSH comes in as I've already suggested.
|

June 21st, 2006, 01:29 AM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 7
Time spent in forums: 1 h 28 m 31 sec
Reputation Power: 0
|
|
|
I agree. I started with the batch direction because it's something that I understand a little. I have no Idea about how to program using wsh. I know at least what it is but that is about it. So I guess my question is how to write a windows script host for the backup of all user accounts. And because I do this on so many different computers it would be easier. wsh would be great because I don't want to install a third party software.
I basically want to bakcup all users accounts and have it organized like this
Username\My documents
\Favorites
\Desktop
\Address Book
\Outlook Express
\Outlook
Username\ect.
Some computers that come through have 10 profiles. just trying to save myself some time
Sorry if I'm being a pain. Nice place to be on the www though.
|

June 21st, 2006, 09:31 PM
|
 |
|
|
Join Date: Jan 2004
Location: New Springfield, OH
|
|
|
This is pretty basic script. I'll write one for you and comment it out so you can see how it works. I'll have it write to drive E: for an example. I'll post back with it.
[EDIT]Wouldn't you want to back up the entire home folder for each profile (except temp folders)?[/EDIT]
|

June 21st, 2006, 11:25 PM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 7
Time spent in forums: 1 h 28 m 31 sec
Reputation Power: 0
|
|
|
excellent I would definately appreciate that. Thanks
yeah Pretty much the whole home folder of the user.
|

May 22nd, 2012, 03:21 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 3
Time spent in forums: 31 m 38 sec
Reputation Power: 0
|
|
|
Followup Nilpo
This is what I was looking for! I didn't see any follow up. I'm looking for the same thing, for the same reason. Backing up customer information.
I already have a batch file that is backing up (by os);
Drivers
installed programs
program keys
and I need to backup their profiles plus I would like to exclude some (administrators and all users) on a case by case basis. If the utility could go through and ask,
backup Administrator? y/n
backup User 1? y/n
backup User 2? y/n
backup Public? y/n
this type of deal.
If you can do that part, I would like to contribute my file.
It creates a folder by date and computer name.
It automatically determines the OS and has sub routine for each OS. I'm not very good but it works well.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|