Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. common_documents folder

common_documents folder

Scheduled Pinned Locked Moved C#
csharptutorialworkspace
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Glen Harvy 0
    wrote on last edited by
    #1

    Hi, I need to get the common_documents environment and it is NOT obtainable using system.environment so I need to use CSIDL and SHGetSpecialFolderPath. Can some one post some example code in c# on how I implement this please. Thanks,

    Glen Harvy

    J S 2 Replies Last reply
    0
    • G Glen Harvy 0

      Hi, I need to get the common_documents environment and it is NOT obtainable using system.environment so I need to use CSIDL and SHGetSpecialFolderPath. Can some one post some example code in c# on how I implement this please. Thanks,

      Glen Harvy

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      string value = Microsoft.Win32.Registry.GetValue(@"HKey_Local_Machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Common Documents", null) as string;

      G 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        string value = Microsoft.Win32.Registry.GetValue(@"HKey_Local_Machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Common Documents", null) as string;

        G Offline
        G Offline
        Glen Harvy 0
        wrote on last edited by
        #3

        Hi, For whatever reason, this does not achieve the result I need (at least on my W2K3 server). I need to install files into the common_documents directory so that any user can edit them (they are template type files). The code you listed does indeed return the correct path as far as I can tell (viz c:\documents and settings\all users\documents) however if I create a sub-directory in that directory it is not being shown in the MyDocuments window. This must have something to do with the network, profiles etc but it seems to me that I cannot achieve my goal as easily as I thought. Thanks for your response - much appreciated.

        Glen Harvy

        J 1 Reply Last reply
        0
        • G Glen Harvy 0

          Hi, For whatever reason, this does not achieve the result I need (at least on my W2K3 server). I need to install files into the common_documents directory so that any user can edit them (they are template type files). The code you listed does indeed return the correct path as far as I can tell (viz c:\documents and settings\all users\documents) however if I create a sub-directory in that directory it is not being shown in the MyDocuments window. This must have something to do with the network, profiles etc but it seems to me that I cannot achieve my goal as easily as I thought. Thanks for your response - much appreciated.

          Glen Harvy

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          Glen Harvy wrote:

          however if I create a sub-directory in that directory it is not being shown in the MyDocuments window.

          Glen Harvy wrote:

          The code you listed does indeed return the correct path as far as I can tell

          Ah, ok, you didn't mention that in your first post. Yeah, it may be wise to look into Win32 shell calls to have this done, but I'm not an expert in that area.

          1 Reply Last reply
          0
          • G Glen Harvy 0

            Hi, I need to get the common_documents environment and it is NOT obtainable using system.environment so I need to use CSIDL and SHGetSpecialFolderPath. Can some one post some example code in c# on how I implement this please. Thanks,

            Glen Harvy

            S Offline
            S Offline
            Scott Dorman
            wrote on last edited by
            #5

            Try taking a look here[^].

            Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


            [Forum Guidelines] [Articles] [Blog]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups