is should do yes, try saving something in there and see if it saves on the computer or on the server.
Did you use it as a login script?
what happens if you run it manually?
Edit: I might know the problem, the registery doesnt know what to do with the " & SUser & ". Try changing it with a folder in the C drive to test it. Then save something and see it it saves in that folder.
You could use %USERNAME% which is how we reference things in our login scripts.
When you redirect them using the regestry it will not copy or move the files automatically they will have to be moved manually or by a script to the new location. You may be able to make a group policy adm template to be able to redirect without using a script if you want to, more information here:
Stop certain folders propagating to the server from laptops.
Sorry have not really had a chance to look into this since last post, have only started getting back onto this again.
Just to confirm what I've done.
I am using the vbscript below:
' 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 Pictures"
strRedirectionPath = "%USERNAME%\Personal Data\My Pictures"
' Write the new Favorites path
objShell.RegWrite strRegKey, strRedirectionPath
' Variable Destruction
Set objShell = Nothing
Set objNetwork = Nothing
I have created a GPO whereby this script runs at logon. At present the result I am getting is that:
When I look in regedit: the registry key has been changed for my pictures to:
%USERNAME%\Personal Data\My Pictures
However, when I go into the users 'My documents folder' the My Pictures folder now appears as '%s's pictures'. This is still being directed to the server, not the local user profile. If I save a file manually inside this folder it still appears on the server.
Does anyone know what's going wrong?
Umm shouldn't it be something like
strRedirectionPath = "C:\Documents and Settings\" & sUser & "\Local Settings\Personal Data\My Pictures"
as at the moment the path would go to nowhere
However, it is still not saving in the relevant place, even though the registry is pointing to the new place.
I don't know if its a problem. But under the type column, for all other reg keys the word 'REG_EXPAND_SZ' appears, whereas the key for this is 'REG_SZ'.
Does anyone know if this will cause an issue?
The difference between 'REG_SZ' and 'REG_EXPAND_SZ' is that the first will not expand environment variables like %USERNAME% where as the latter will. If the value is right this should not have any effect on your script as it expands the variable beforehand in VB.
robbied69 (11th September 2008)
I have also been looking into redirecting My Music. Its quite frustrating and tricky and something i was never able to do. I wanted to redirect the my music to the root of the local drive. But after many hours no luck
There are currently 1 users browsing this thread. (0 members and 1 guests)