Hi All,

I am working with PowerShell and Windows 7 libraries. I am successful with removing a library, adding a new one but I am coming up at a loss adding the currently logged in users 'My Music' folder to the library.

I presume that it is not liking the %userprofile% on the add folder. The issue is that there could be other users on this computer and all users are on a domain.

Any help would be appreciated!
@echo off

Echo Remove Music Library
del "%userprofile%\AppData\Roaming\Microsoft\Windows\L ibraries\Music.library-ms"
pause

Echo Create Music library for current user (run in user context)
shlib create "%userprofile%\AppData\Roaming\Microsoft\Windows\L ibraries\Music.library-ms"
pause

shlib add "%userprofile%\AppData\Roaming\Microsoft\Windo ws\
Libraries\Music.library-ms" "%userprofile%\My Music"

Pause