Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 423
  • Last Modified:

My Music Redirection - Custom ADM files

I've read all the posts on redirecting the My Music folder and don't agree that it can't be done.  I've nearly got it finished but need help figuring out one detail.  Here is the scenario.  Initially i tried using a script to get the redirection working only to find that if the script loads after the desktop has already been loaded the registry entries are pretty much useless (at least for folder redirection).  So, I tried running the scripts synchronously only to find out that the GPO takes precedence over the script and essentially nullifies the entries that the script changes.  I've finally come to writing my own .adm file and loading it into the GPO directly.  This seems to work fine except that I'm using this GPO for multiple users and the My Music destination needs to change to their local profile.  When writing a script it is possible to get that information using the %username% variable (which can be attained by querying the system) however using the same variable in the .adm file writes the exact path in the registry and not the decoded path ex.  I want to send music to C:\Documents and Settings\billy.crystal\My Documents\My Music where 'billy.crystal' is %username% initially but when the GPO is loaded I get C:\Documents and Settings\%username%\My Documents\My Music in the registry and not the actual user's name.  Does anyone know how to resolve this?  
I suspect there is an answer to this because when you redirect the My Pictures folder in the MMC console you are allowed to use the %username% variable in the path.
0
-_-aaron-_-
Asked:
-_-aaron-_-
  • 3
  • 2
1 Solution
 
oBdACommented:
Yes, there is an answer to this.
EDITTEXT will write to a REG_SZ value by default; this string type will not be expanded. You need REG_EXPAND_SZ; this is done by specifying EXPANDABLETEXT; for example:

PART "My Music Redirection Target Path:" EDITTEXT REQUIRED EXPANDABLETEXT
  VALUENAME "Favorites"
END PART

Administrative Template File Format
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/policy/policy/administrative_template_file_format.asp
0
 
Nirmal SharmaSolution ArchitectCommented:
?
0
 
-_-aaron-_-Author Commented:
Although that would seem to work for other registry entries the My Documents situation happens to be a bit of a stickler.  The my documents folder seems to be closely tied in with several system dlls that for some reason will not allow me to disassociate the My Music folder from the location of the My Documents folder.  Has anyone done this in real life (no theories please, i've tried many)?  
oBda...that was a good answer and unless someone can give me an exact answer as to how to redirect the folders I'll give you the credit (either way i'll give you partial credit).

Other thoughts... are there other registry entries/files tied to the My Music redirection...
Making changes to the My Documents registry entries has no effect on changing the location however if you right click and modify the My Documents folder directly the changes take effect immediately (thereby moving the my pictures and my music folders too)
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
oBdACommented:
I haven't tried to redirect the "My Music" folder separately yet, just the regular folder redirection policy of "My Documents". A separate redirection of Favorites and Cookies works. You're using Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, I assume?
0
 
-_-aaron-_-Author Commented:
Yes.
0
 
-_-aaron-_-Author Commented:
Be prepared to pull your hair out...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now