Windows Vista Forums

HOMEPATH

  1. #1


    James Guest

    HOMEPATH

    This post relates to the HELP post I put up a few days ago. I found the
    root cause of the problem. I am using the HOMEPATH to find where the end
    users desktop, favorites, etc...live. Then I copy their stuff up to their
    mapped user directory. The reason why the copy is not working for everyone
    is that the HOMEPATH is only returning a "\" for a very few people. I
    simply put up a message box to catch it as follows....

    'Set Homepath
    strHomePath = WshSysEnv("HOMEPATH")
    msgbox strHomePath

    The script should return something like "\documents and settings\username".
    But for a few folks it will only return the "\". I am able to logon to the
    same machine and run the script under my credentials and it works great. I
    am assuming it means something is hosed or corrupted with the users profile.
    Do you have any idea why it will not return the correct HOMEPATH for the
    user?



    James



      My System SpecsSystem Spec

  2. #2


    James Guest

    Re: HOMEPATH

    I finally found a fix to this problem!

    I changed from:

    strHomePath = WshSysEnv("HOMEPATH")

    To:

    strHomePath = WshSysEnv("USERPROFILE")

    All is working perfectly now!

    So, if anyone wants a simple script to backup a user profile (documents
    only) to a mapped network drive, let me know and I will post it. Once I
    update my ProfileRestore I can post that as well, if anyone wants it.
    Thanks to everyone who helped me out these past few weeks, you know who you
    are! Now I feel like I might be able to help others looking for the same
    type of stuff.



    James

    "James" <donotemailme@xxxxxx> wrote in message
    news:ude%23kVPJKHA.4316@xxxxxx

    > This post relates to the HELP post I put up a few days ago. I found the
    > root cause of the problem. I am using the HOMEPATH to find where the end
    > users desktop, favorites, etc...live. Then I copy their stuff up to their
    > mapped user directory. The reason why the copy is not working for
    > everyone is that the HOMEPATH is only returning a "\" for a very few
    > people. I simply put up a message box to catch it as follows....
    >
    > 'Set Homepath
    > strHomePath = WshSysEnv("HOMEPATH")
    > msgbox strHomePath
    >
    > The script should return something like "\documents and
    > settings\username". But for a few folks it will only return the "\". I am
    > able to logon to the same machine and run the script under my credentials
    > and it works great. I am assuming it means something is hosed or
    > corrupted with the users profile. Do you have any idea why it will not
    > return the correct HOMEPATH for the user?
    >
    > James
    >


      My System SpecsSystem Spec

HOMEPATH

Similar Threads
Thread Thread Starter Forum Replies Last Post
Homedrive and homepath Martin Lundberg Vista General 3 04 Oct 2007