Jump to content

%Userprofile% Variable not being set.


Recommended Posts

Posted

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?

Posted

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?

Posted

There seems to be random things left in here

 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\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?

Posted

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\CurrentVersion\Explorer\Shell Folders\Personal

 

and

 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\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?

Posted

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?

Posted
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% :)

Posted
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.

Posted

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?

Posted

@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.

Posted
@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.

Posted

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!

Posted

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

Posted
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"
Posted
I have a GPO re-direct of the My Docs folder to the H drive, but on the roamings it can sometimes go a bit funny and not apply the GPO so I teach people to use the H: drive still, also some programs don't like the My Documents for some reason so having a H: is better.
Posted

Up until recently, I have done the same as Ric, and used the 'redirect to users' home drive' setting. This is not the recommended way of doing things though (MS article).

 

Now I use the 'Basic - Redirect everyone’s folder to the same location.' option and point it to a location like \\server\userdatashare\staff. Provided the permissions are correctly set, this results in a structure as follows;

 

\\server\userdatashare\staff\Username

\\server\userdatashare\staff\Username\My Documents

\\server\userdatashare\staff\Username\Application Data

\\server\userdatashare\staff\Username\Desktop

 

I still use the home drive setting on the user account, but it is set to \\server\userdatashare\staff\%username%\My Documents.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...