Moving favorites to %username% location

Joined
27 Jan 2004
Messages
80
Reaction score
0
Location
Bournemouth
Country
United Kingdom
In the company I work for we do not allow users to access their C:\ as a security measure. The problem with this is it means they cannot access their Favorites.

I am attempting to create a .reg file which moves the location of their Favorites to a shared location on a server. I have amended my own registry to point the Favorites key at a location something like this:

\\hostname\file\%username%\favorites.

I then export the key from within regedit to create a .reg file. The problem is that when I get another user to try and install the registry change it changes their registry key to include my username even though I have specified %username%?

Can anyone please help?
 
Sponsored Links
Hi,

Why dont you setup your server as a domain controloer - that way you have full control over where the users profiles sits.
How have you restricted access to c:\ ? Doesnt sound like its setup quite right to me, theres many files that reside on C: that are accessed by windows all the time - some use the system account, some user the local users account.

Anyway, failing that, just change the default user profile - of course that will only affect new users, or how about a group policy (or local policy) - again if not on a domain it would involve manually configuring the workstations, how many are there?
The way you want to do it is a bit odd, your users certainly shouldnt be able to make changes to the registry.

Sorry for the hurried reply, have a think and post back - the way you want to do it is really a no-no.
 
Hi Eggplant,

Thanks for the response. I'm sorry I probably didn't give enough info in my original post, the server (application server) is already within a domain which has two domain controllers, the access to the C:\ is restricted using Active Directories. (I have tried to relocate favorites using Group policy from within AD but it only seems to allow you to do my docs etc using folder redirection). Each user is in an Organizational Unit within AD and the GPO's set the appropriate securities for that OU. The GPO's also stop the users from accessing their registry editor. We also use roaming profiles.

The way I'm trying to do it is make each user a member (temporarily) of a security group within AD set up to give them authority to update their registry, then email all users a link to the .reg file I have created, get each of them to install the registry change then remove them from that security group.

I hope that gives you a bit more undersatnding of our set up. If you can suggest any other way of me rolling out this change it would gratefully be received?
 
Roaming profiles would be an easier option.

Edit. Can you post a copy of your reg file anyway, so we can see what you have done?
 
Sponsored Links
Ok, dead easy, apologies in my last post, I said do it with a GP but there isnt one ! You need the IEAK which will then give you the policy to redirect favs. I install it by default and of course if we do that then we somtimes forget it isnt there as standard.


http://www.microsoft.com/technet/prodtechnol/ie/ieak/default.mspx

The way I'm trying to do it is make each user a member (temporarily) of a security group within AD set up to give them authority to update their registry, then email all users a link to the .reg file I have created, get each of them to install the registry change then remove them from that security group. [/quoet]
Thats a bodge! But would work, I must admit I've done it in the past - sometimes easier.
 
I'd be the first to agree with you that it's a bodge, but I'm looking for the easiest solution to my problem and believe that the way I described would have a much smaller impact on the user base?

I have looked at the IEAK and as I am not familiar with it in the slightest suspect it would take me some time to set up before even getting to make the minor change I am attempting to make. I am also conscious of the fact that I'm amending a live environment so that also makes me a little nervous of using something like that that I am not fully versed on.

Igorian, this was the latest attempted .reg file:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Favorites"=hex(2):5c,00,5c,00,65,00,61,00,73,00,74,00,6c,00,61,00,6e,00,64,00,\
73,00,73,00,30,00,32,00,32,00,5c,00,75,00,73,00,65,00,72,00,70,00,72,00,6f,\
00,66,00,69,00,6c,00,65,00,73,00,5c,00,25,00,75,00,73,00,65,00,72,00,6e,00,\
61,00,6d,00,65,00,25,00,5c,00,66,00,61,00,76,00,6f,00,72,00,69,00,74,00,65,\
00,73,00,00,00

Appreciate all your help so far guys.
 
What's wrong, are you not fluent in binary? ;)

Well it's as I've mentioned above, I've modified the value data of the key (shown below) to something like this:

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

\\servername\userprofiles\%username%\favorites

Then I export it thus creating the .reg. But when a user opens it an adds it to their registry it appears in the registry using my own user name and not theirs, even though %username% has been used. I have checked the .reg file binary against that in my registry and it is %username%?

Any ideas?
 
Ok, it looks like the environment variable is being resolved when you make the reg change. It is then exporting the resolved name to the reg file. Edit the reg file AFTER exporting it and change the usename to %USERNAME% and then save it. Use this edited file as the template to import.
 
I have edited the .reg file after exporting it, I've edited/viewed the .reg and compared the binary with that in my registry, my registry is correctly showing %username% and the binary in the exported file is exactly the same?
 
Hi,

All you need from the IEAK is the custom adm template, or why not just write your own since you know what the reg key is?
By the way the above is hex not binary ;)

Give me 30 mins I'll just have me tea then I'll do you a script.
 
ok mate, copy/pasete this and stick it in a vbs, then use it as a login script


Set objNet = CreateObject("WScript.NetWork")

Set objShell = CreateObject("WScript.Shell")

StrServerName = "SERVERNAME"

StrShareName= "userprofiles"

strUserName= objNet.UserName

objShell.regwrite "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Favorites", "\\" & StrServerName & "\" & StrShareName & "\" & strUserName & "\Favorites", "REG_EXPAND_SZ"

Wscript.quit

Ive deliberatly left spaces between the lines, obviously remove these, I did it so you can see where a new line starts. the lines above that DONT have a gap are on the same line.
Theres 2 variables as you can see, StrServerName and StrShareName, set these to whatever they are on your server. if you get stuck post back.


Regards

EDIT:
IS IT SHELL FOLDERS OR USER SHELL FOLDERS WE NEED TO CHANGE?
 
I did have a go here and it seems to work ok. I even emulated your path:

\\eastlandss922\userprofiles\%username%\favorites

Have you had a look at the users registry after the import?
 
Sponsored Links
Back
Top