Relocating iTunes music on Windows

Problem:

On my corporate image Windows XP laptop, “My Documents“, “My Photos“, “My Music” etc. secretly live on my (uber redundant, backed up, etc) network home directory. That’s a great idea for most things, but when I’m away from the network, iTunes can’t find its index files and complains at launch, saying,

The folder “iTunes” cannot be found or created, and is required. The default location for this folder is inside the “My Music” folder.

Complications

  • You can change where iTunes keeps the actual music files in the iTunes preferences (Advanced tab, General tab, “iTunes Music folder location”), but the files where iTunes stores the details about your music collection (notably iTunes Music Library.xml and iTunesLibrary.itl) live in your “My Music” folder by default.
  • If I recall, the Win2KMyMusicFolder value in HKEY_CURRENT_USER\Software\Apple Computer, Inc.\iTunes tends to get overwritten by iTunes updates. I’m not sure about that though– hacking it might be enough too.
  • The “My Music” Shell Folder registry key, in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, gets reset by my corporate login script whenever I log in, so changing it doesn’t help.Otherwise, I think hacking it would have been sufficient.

Solution:

  1. Copy the iTunes directory from your existing My Music directory (in my case my network home directory) to your new location (in my case, C:\Documents and Settings\myusername\My Music).
  2. Create a new REG_EXPAND_SZ registry key named “My Music” in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders and set it to %USERPROFILE%\My Music.
  3. Log off of Windows and log back in.