Please help: Batch file backup

By Canadian
May 7, 2008
  1. I just started working at the local computer store, and when we backup users data we usually just grab the favorites, documents, desktop, and the Outlook Express database. We copy these to an external.

    I would like to create a batch file I can just put in the destination folder on the external, and have it copy all the current users data for me. How would I do that?
    I tried using the %userprofile% but it doesn't seem to work when you dont have drive c: selected.

  2. jobeard

    jobeard TS Ambassador Posts: 8,945   +584

    describe the partitioning of the local system, which drive letter is the boot device
    and where the userprofiles are located.

    the %USERPROFILE% contains the %HOMEDRIVE% and thus 'should' be correct
    for all cases.

    did someone hack the environment vars on the system?
  3. Canadian

    Canadian TS Rookie Topic Starter Posts: 77

    Has drive C: as the main harddrive, a drive D: as a CD drive, and a drive E: as the external.
  4. jobeard

    jobeard TS Ambassador Posts: 8,945   +584

    then the Boot drive and all user profiles are on C:\

    so what's wrong with %USERPROFILE% when you access it in the bat file?
    hint; use rem %USERPROFILE% to show the value or just
    run->cmd and then enter SET to see the value
  5. Canadian

    Canadian TS Rookie Topic Starter Posts: 77

    The batch file is on drive E:
    When you do that from drive E: it cant seem to find those folders
  6. jobeard

    jobeard TS Ambassador Posts: 8,945   +584

    of course not.

    add C: to the top of the bat file :)
Topic Status:
Not open for further replies.

Similar Topics

Create an account or login to comment

You need to be a member in order to leave a comment
TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...

Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.