Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Registry setting for "My Documents" folder location  (Read 3541 times)

0 Members and 1 Guest are viewing this topic.

pman

    Topic Starter


    Rookie
    Registry setting for "My Documents" folder location
    « on: July 23, 2008, 08:07:36 PM »
    Hi, Would you be able to tell me where in the registry the settings are that stores the location of "My Documents" folder. I know you can change it by going to the properties of this folder and changing the target field, but how can I do it through the registry settings.

    Just trying to find an automated way of doing it instead of manual process. I've been googling about this registry setting, but can't find any.

    Broni


      Mastermind
    • Kraków my love :)
    • Thanked: 614
      • Computer Help Forum
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 8
    Re: Registry setting for "My Documents" folder location
    « Reply #1 on: July 23, 2008, 08:37:25 PM »
    You don't have to play with registry:
    http://support.microsoft.com/kb/310147

    pman

      Topic Starter


      Rookie
      Re: Registry setting for "My Documents" folder location
      « Reply #2 on: July 24, 2008, 05:41:51 AM »
      Hi Broni,

      I actually read that page before. Whatever is mentioned in that page, requires manual process. You have to right click->select properties->change the path in the target field, etc.

      I'm trying to do all that through a vbscript or any other script so that no manual process is necessary.

      Sidewinder



        Guru

        Thanked: 139
      • Experience: Familiar
      • OS: Windows 10
      Re: Registry setting for "My Documents" folder location
      « Reply #3 on: July 24, 2008, 06:34:07 AM »
      Quote
      I'm trying to do all that through a vbscript or any other script so that no manual process is necessary.

      This is pretty much boilerplate code. My Documents has subfolders (My Music, My Videos, etc) which are not processed by this script.

      Code: [Select]
      Const HKEY_CURRENT_USER = &H80000001

      strComputer = "."
       
      Set objRegistry=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
       
      strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
      strValueName = "Personal"
      strValue =                     'new value goes here (quoted)

      objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue

      You will need to set the value of strValue before running the script. When messing with the registry, I suggest a system restore point or exporting the affected registry branch to a file. You can never be too careful.

       8)


      The true sign of intelligence is not knowledge but imagination.

      -- Albert Einstein

      soybean



        Genius
      • The first soybean ever to learn the computer.
      • Thanked: 469
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 10
      Re: Registry setting for "My Documents" folder location
      « Reply #4 on: July 24, 2008, 07:31:09 AM »
      Hi Broni,

      I actually read that page before. Whatever is mentioned in that page, requires manual process. You have to c, etc. right click->select properties->change the path in the target field

      I'm trying to do all that through a vbscript or any other script so that no manual process is necessary.
      Strange reasoning, very strange.  How is your idea doing this via the registry any less manual than "right click->select properties->change the path in the target field"?  Your're going spend a lot more time figuring out how to do this your way than the way Microsoft has provided to easily do it.  Also, I don't know why you even call "right click->select properties->change the path in the target field" a manual process.  Indeed, I see your way as more manual than the Move procedure that's readily available.

      Spoiler



        Specialist

        Thanked: 50
      • Experience: Beginner
      • OS: Windows XP
      Re: Registry setting for "My Documents" folder location
      « Reply #5 on: July 24, 2008, 08:08:43 AM »
      You also can set a group policy in a AD domain. This would force the change to move the My Docs folder to say a server that could be backed up to tape.

      Whenever I watch TV and I see those poor starving kids all over the world, I can't help but cry. I mean I would love to be skinny like that, but not with all those flies and death and stuff." - Mariah Carey, Pop Singer

      pman

        Topic Starter


        Rookie
        Re: Registry setting for "My Documents" folder location
        « Reply #6 on: July 24, 2008, 06:29:28 PM »
        Hi Broni,

        I actually read that page before. Whatever is mentioned in that page, requires manual process. You have to c, etc. right click->select properties->change the path in the target field

        I'm trying to do all that through a vbscript or any other script so that no manual process is necessary.
        Strange reasoning, very strange.  How is your idea doing this via the registry any less manual than "right click->select properties->change the path in the target field"?  Your're going spend a lot more time figuring out how to do this your way than the way Microsoft has provided to easily do it.  Also, I don't know why you even call "right click->select properties->change the path in the target field" a manual process.  Indeed, I see your way as more manual than the Move procedure that's readily available.

        Soybean, The reason you find this strange or even more manual is because I didn't mention why I want to use a script. I didn't think I needed to. If you were to do this once in a while, then yes, it's better AND easier to do it by changing the properties. But if you are doing it frequently when supporting a lot of users on a regular basis, then it might be easier to use a script that you can run on the remote computer and everything will be set without having to do anything manually or even having the user involved.


        Sidewinder, Thanks so much for your script. I will play with it and see how I can work with it.

        Spoiler, You are right about the group policy, but unfortunately it's not being done that way at my place. At least not yet. May be in future.