Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - HOMEPATH

Reply
 
Old 08-24-2009   #1 (permalink)
James


 
 

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
Old 08-24-2009   #2 (permalink)
James


 
 

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
Quote:

> 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
Reply

Thread Tools


Similar Threads
Thread Forum
Homedrive and homepath Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46