Using environment variables in roaming profiles....

G

Guest

Hi,

Hoping someone can hel me out with a little profile problem.
Our users have roaming profiles and can log onto machines running either XP
or 2K.

The profile is stored on the server in directory \\server1\userA\XP or
\\server1\userA\2k and we have an environment variable %MyOS% which is set to
either 'XP' or '2k'

The registry key 'CentralProfile' contains \\server1\userA\%MyOS%

However, this is not working and instead of translating the %MyOS% it is
simply storing the profile in a directory called %MyOS%

Anyone have any ideas on getting this to work correctly ?

Any help and/or advice much appreciated.

Thanks.
 
P

Pegasus \(MVP\)

Angahran said:
Hi,

Hoping someone can hel me out with a little profile problem.
Our users have roaming profiles and can log onto machines running either XP
or 2K.

The profile is stored on the server in directory \\server1\userA\XP or
\\server1\userA\2k and we have an environment variable %MyOS% which is set to
either 'XP' or '2k'

The registry key 'CentralProfile' contains \\server1\userA\%MyOS%

However, this is not working and instead of translating the %MyOS% it is
simply storing the profile in a directory called %MyOS%

Anyone have any ideas on getting this to work correctly ?

Any help and/or advice much appreciated.

Thanks.

Make Central Profile a value of type REG_EXPAND_SZ instead of REG_SZ.
 
G

Guest

Thanks, that makes sense from looking at other keys of that type.

One minor question... how do I make it that type ?
Registry editor only appears to allow the entry of REG_SZ for string type.
I guess I could export the key, modify the .reg file then reimport ?

Thanks.
 
G

Guest

Thanks Pegasus,

Currently using Win2k, someone suggested regedt32 which appeared to do the
job.
Unfortunately it seems something in the login/logout procedure is reseting
the key back to its original state.

Ang.
 
P

Pegasus \(MVP\)

You should post in a Win2000 group when dealing
with Win2000 issues.

Your observation about the key not sticking is at variance
with my own experience. When I change this key while
logged on as administrator then it sticks.
 
G

Guest

Well, we are booting XP/2k so either way I'd be in the wrong forum :p

When I amend the key and log out, it does create a profile directory on the
server, BUT, the directory is called %OS% and not "Windows_NT" which it
should have been for 2k. (Do you know what the %OS% variable translates to
for XP?)

Got the 'CentralProfile' key as REG_EXPAND_SZ but not seeming to work :(

And when I log back in the key has been reset.
Guessing this is being reset via login scripts somewhere.

Ang.
 
P

Pegasus \(MVP\)

%OS% will expand into Windows_NT both under Win2000
and WinXP.

Roaming profiles will replace parts of the local registry with
data held on the server. It's the server version you have to
modify, not the local version.
 
G

Guest

Thanks again,

That makes %OS% a fairly useless variable, was hoping it would be different
under 2k and XP.

Will have to get hold of our IT support people see about fixing the server
data.
 
P

Pegasus \(MVP\)

Use the "ver" command to extract the OS version,
then write your own variable into the registry!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top