Jump to content

Exclude My Music from Folder Redirection


Recommended Posts

Guest Robert Dadomo
Posted

Does anyone have a script whereby the My Music folder is omitted from the Folder Redirection policy. I found a vbscript:

 

' Variable Initilisations

Set objShell = CreateObject("WScript.Shell")

Set objNetwork = CreateObject("WScript.Network")

strUsername = objNetwork.UserName

sUser = objNetwork.username

strUserName = objNetwork.UserName

strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\User Shell Folders\My Music"

strRedirectionPath = "%USERPROFILE%\Personal Data\My Music"

 

' Write the new Favorites path

objShell.RegWrite strRegKey, strRedirectionPath

 

' Variable Destruction

Set objShell = Nothing

Set objNetwork = Nothing

 

When I log in to test, I can see the registry key has been changed to '%USERPROFILE%\Personal Data\My Music'. However, when I navigate to 'My Music' in the My documents folder it still appears to be saving to the server and the name of the folder appears as '%s's Music'.

 

My main aim is to have a shortcut in the user's my documents folder, whereby they click the my music link and it goes to the users local profile.

 

Can anyone help me?

 

Many Thanks

 

Can any kind soul help me to where I'm going wrong?

 

Many thanks

 

Robert

  • Replies 1
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: Exclude My Music from Folder Redirection

 

 

<Robert Dadomo> wrote in message

news:2008912121432robert.dadomo@globalrealestate.org...

> Does anyone have a script whereby the My Music folder is omitted from the

> Folder Redirection policy. I found a vbscript:

>

> ' Variable Initilisations

> Set objShell = CreateObject("WScript.Shell")

> Set objNetwork = CreateObject("WScript.Network")

> strUsername = objNetwork.UserName

> sUser = objNetwork.username

> strUserName = objNetwork.UserName

> strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\User

> Shell Folders\My Music"

> strRedirectionPath = "%USERPROFILE%\Personal Data\My Music"

>

> ' Write the new Favorites path

> objShell.RegWrite strRegKey, strRedirectionPath

>

> ' Variable Destruction

> Set objShell = Nothing

> Set objNetwork = Nothing

>

> When I log in to test, I can see the registry key has been changed to

> '%USERPROFILE%\Personal Data\My Music'. However, when I navigate to 'My

> Music' in the My documents folder it still appears to be saving to the

> server and the name of the folder appears as '%s's Music'.

>

> My main aim is to have a shortcut in the user's my documents folder,

> whereby they click the my music link and it goes to the users local

> profile.

>

> Can anyone help me?

>

> Many Thanks

>

> Can any kind soul help me to where I'm going wrong?

>

> Many thanks

>

> Robert

 

"public.windows.server.scripting" would be a much better group for this

question.


×
×
  • Create New...