+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
Windows Thread, %Userprofile% Variable not being set. in Technical; Hi We have been having a few schools who use a drive letter method of saving work rather than using ...
  1. #1

    Join Date
    Jul 2005
    Location
    Blackburn, Lancashire
    Posts
    123
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    %Userprofile% Variable not being set.

    Hi

    We have been having a few schools who use a drive letter method of saving work rather than using the My Documents variable. Therefore the My Documents variable is not set. Which method is used most in schools?

    Does this cause problems with other programs?

  2. #2
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    33

    Re: %Userprofile% Variable not being set.

    Presumably you mean that the My Documents location is not pointing to the same place as the users' home drives. I cannot speak for others, but in our schools, we use the H: drive for each user's home directory, and redirect My Documents to the same location using Group Policy.

    I have come across many programs that will not work correctly with redirected folders, but none that fail to work with drive letters.

    Are the schools in question using a proprietary system (eg RM CC3), or mandatory profiles?

  3. #3

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,374
    Thank Post
    625
    Thanked 951 Times in 653 Posts
    Blog Entries
    2
    Rep Power
    318

    Re: %Userprofile% Variable not being set.

    Our CC3 network uses N: which is also My Documents, best of both worlds

  4. #4
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,938
    Thank Post
    114
    Thanked 272 Times in 250 Posts
    Rep Power
    104

    Re: %Userprofile% Variable not being set.

    Quote Originally Posted by webman
    Our CC3 network uses N: which is also My Documents, best of both worlds
    I also use a drive letter and redirect my docs to it.

  5. #5

    Join Date
    Jul 2005
    Location
    Blackburn, Lancashire
    Posts
    123
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: %Userprofile% Variable not being set.

    There seems to be random things left in here

    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\User Shell Folders

    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Shell Folders

    Maybe from old servers, current servers etc.

    They are mandatory.

    Do you think it wise there always be a My Documents variable to be on the safe side?

  6. #6
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    33

    Re: %Userprofile% Variable not being set.

    Dan, when you talk about a My Documents 'variable', what do you mean? To my knowledge, there are two registry values; (Microsoft info)

    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Shell Folders\Personal

    and

    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\User Shell Folders\Personal


    The first of these is only there for legacy purposes.

    Then there is the %USERPROFILE% 'environment variable, which will always point to the local copy of the user's profile (usually C:\Documents and Settings\%USERNAME%)

    Now, when you say the 'variable' is missing, which one is it?

  7. #7

    Join Date
    Jul 2005
    Location
    Blackburn, Lancashire
    Posts
    123
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: %Userprofile% Variable not being set.

    The 3 variables are

    My Pictures
    My Music
    Personal

    Some of the above have been changed to a network location and it maybe that it is an invalid path. The effect of these being not valid is the software will not run, We change them manually and it works but they get changed back again after a

    Are these paths set by group policy?

    logon/logoff/reboot.

    Should software written these days accomodate for these not being valid? Or should the personal variable be always available to the user?

  8. #8

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223

    Re: %Userprofile% Variable not being set.

    Then there is the %USERPROFILE% 'environment variable, which will always point to the local copy of the user's profile (usually C:\Documents and Settings\%USERNAME%)
    and %HOMEPATH%

  9. #9
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    33

    Re: %Userprofile% Variable not being set.

    Quote Originally Posted by drjturner
    The 3 variables are

    My Pictures
    My Music
    Personal

    Some of the above have been changed to a network location and it maybe that it is an invalid path. The effect of these being not valid is the software will not run, We change them manually and it works but they get changed back again after a

    Are these paths set by group policy?

    logon/logoff/reboot.

    Should software written these days accomodate for these not being valid? Or should the personal variable be always available to the user?
    If the profile is 'mandatory' and nothing else is in effect (ie no Group Policy folder redirection and no logon script redirecting the folders), then the settings will revert each time the user logs off.

    It could also be that Group Policy IS in effect, but is setting the wrong path. (Use Group Policy Management Console to verify which Group Policies affect which users on which machines).

    Similarly, a logon script could also be modifying the paths and setting the wrong location.

    Assuming the profile is being shared amongst several users (that's how I do it anyway), then something else is required to redirect My Documents to the appropriate home directory for the user logging on. As I have mentioned, this can be achieved with Group Policy or a logon script.

    As regards what software should do, I would say that it should default to the location pointed to by 'My Documents'.

    It would be nice if the software did not crash completely if that location did not exist, or was read-only though.

    It should also be possible to change the default location on a per-user basis (this information should then be stored in the Current User registry although this would obviously fail on a mandatory profile).

    If the software is designed to use 'shared' data, then it would probably make sense to have an override facility (stored in Local Machine registry, or an INI file in the application folder), which can be used to point to a network location.

  10. #10

    Join Date
    Jul 2005
    Location
    Blackburn, Lancashire
    Posts
    123
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: %Userprofile% Variable not being set.

    Do you think then that there should be error messages explaining what the exact problem is.

    eg.

    "Error 123 There is an invalid path in value called %My Pictures% Please contact your network administrator to resolve this issue?"

    Rather than the standard vb ones?

  11. #11

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,582
    Thank Post
    107
    Thanked 761 Times in 592 Posts
    Rep Power
    179

    Re: %Userprofile% Variable not being set.

    @drjturner: Did you really just ask if your error messages hould make sense?

    Just a note, I too use H: for the homedrive of each user and then use a GPO to redirect My Documents to the users homedrive.

    As has been mentioned above, use the GPMC to check whether a GPO redirects the location(s) but doesn't have a new location set.

  12. #12

    Join Date
    Jul 2005
    Location
    Blackburn, Lancashire
    Posts
    123
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: %Userprofile% Variable not being set.

    Quote Originally Posted by Ric_
    @drjturner: Did you really just ask if your error messages hould make sense?

    Just a note, I too use H: for the homedrive of each user and then use a GPO to redirect My Documents to the users homedrive.

    As has been mentioned above, use the GPMC to check whether a GPO redirects the location(s) but doesn't have a new location set.
    When we get support calls about these kind of problems it is very hard to say it is a network issue and sort it out yourself bye bye, we do try and help to a fashion and it would be good to be well equipped on either making error messages that are more informative to the admin teams and kb articles to back them up and also have a document that explains what my document redirection is and where to look to configure it.

    Is it habit from the old Novell/NT4 days to have a h drive?

    Thanks a lot for the hints.

  13. #13
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    33

    Re: %Userprofile% Variable not being set.

    I suppose (without thinking about it too much), that if your program can't find the folder it is looking for then it should display an error message that the end user can understand and give them some guidance as to what they should do. If possible, it should log the exact details of the problem in the event log or a text log file which tech support staff can examine to found out exactly what went wrong.

    If your app is looking for 'My Pictures' and it's not available, then I think it would be reasonable to default instead to 'My Documents' and give a message to that effect. That way the application could continue to work. What it should NOT do is default back to the application folder under Program Files, or the root of the C: drive.

    As to why we use a home drive letter, yes I suppose it is a hangover from the NT4 days. As I said though, there is a LOT of software out there with completely ignores Microsoft's guidance on application standards and will not work with UNC paths at all. I regularly have to jump through hoops to make software like this work.

    Some software looks at the path that My Documents is redirected to the moment it is installed and records this is an INI file or a Local Machine registry entry. This is then the default path, regardless of who logs on!

  14. #14

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    12,966
    Thank Post
    587
    Thanked 1,494 Times in 1,340 Posts
    Rep Power
    397

    Re: %Userprofile% Variable not being set.

    Those of you that say you redirect to a home drive are you saying you map their home drive i.e h:\ using a log on script and then within the folder redirection policy then set this to point to h:\ for the my documents redirection?

    Ben

  15. #15

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,582
    Thank Post
    107
    Thanked 761 Times in 592 Posts
    Rep Power
    179

    Re: %Userprofile% Variable not being set.

    I use the field in the user properties to map the homedrive. There is then an option on the drop-down in the My Documents redirection that says something a long the lines of "redirect everybody's My Documents to the same place" -> "redirect to users' homedrive"

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Moodle - undefined variable error
    By damienharrison in forum Virtual Learning Platforms
    Replies: 5
    Last Post: 26th September 2007, 10:15 AM
  2. Username variable in the 'Connect to' box?
    By Andie in forum Windows
    Replies: 2
    Last Post: 22nd May 2007, 12:22 PM
  3. Batch: Text file -> Environment variable?
    By PiqueABoo in forum Scripts
    Replies: 5
    Last Post: 13th December 2006, 11:09 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •