#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    7
    Rep 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.
  2. #2
  3. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,170
    Rep Power
    1469
    Would it be easier for you to use a program such as Cobian Backup instead?
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  4. #3
  5. Periodically energetic Perler
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2005
    Location
    Dublin, Ireland
    Posts
    2,265
    Rep Power
    537
    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

    Comments on this post

    • Nilpo agrees
    Vi Veri Veniversum Vivus Vici.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    7
    Rep 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.
  8. #5
  9. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,170
    Rep Power
    1469
    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.
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  10. #6
  11. Providing fuel for space ships
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2004
    Location
    nr Edinburgh, Scotland
    Posts
    14,382
    Rep Power
    3848
    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
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    7
    Rep 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.

    @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"
  14. #8
  15. Periodically energetic Perler
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2005
    Location
    Dublin, Ireland
    Posts
    2,265
    Rep Power
    537
    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
    Vi Veri Veniversum Vivus Vici.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    7
    Rep 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.
  18. #10
  19. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,170
    Rep Power
    1469
    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.
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    7
    Rep 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.
  22. #12
  23. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,170
    Rep Power
    1469
    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]
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    7
    Rep Power
    0
    excellent I would definately appreciate that. Thanks
    yeah Pretty much the whole home folder of the user.
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2006
    Posts
    3
    Rep 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.

IMN logo majestic logo threadwatch logo seochat tools logo