Please help: Batch file backup

By Canadian
May 7, 2008
Topic Status:
Not open for further replies.
  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.


    Thanks.
  2. jobeard

    jobeard TS Ambassador Posts: 13,285   +281

    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 Newcomer, in training Topic Starter Posts: 102

    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: 13,285   +281

    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 Newcomer, in training Topic Starter Posts: 102

    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: 13,285   +281

    of course not.

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


Add New 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.