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 / C++ / MFC
  4. File Locations on Win 7

File Locations on Win 7

Scheduled Pinned Locked Moved C / C++ / MFC
question
9 Posts 6 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.
  • S Offline
    S Offline
    softwaremonkey
    wrote on last edited by
    #1

    Hi, Not sure if this question belongs here but I wondered if there is a location on the disk where I can gaurantee that I can always write a file to under Windows 7. In the good old days of XP I could use C:\ but thats a no-no (I guess it was under XP but hey!). Thanks Tony :thumbsup:

    A _ _ S J 5 Replies Last reply
    0
    • S softwaremonkey

      Hi, Not sure if this question belongs here but I wondered if there is a location on the disk where I can gaurantee that I can always write a file to under Windows 7. In the good old days of XP I could use C:\ but thats a no-no (I guess it was under XP but hey!). Thanks Tony :thumbsup:

      A Offline
      A Offline
      Andre Kraak
      wrote on last edited by
      #2

      You could use the C:\Users\Public\Documents folder for this. All users on a Windows 7 machine should have access to it.

      0100000101101110011001000111001011101001

      1 Reply Last reply
      0
      • S softwaremonkey

        Hi, Not sure if this question belongs here but I wondered if there is a location on the disk where I can gaurantee that I can always write a file to under Windows 7. In the good old days of XP I could use C:\ but thats a no-no (I guess it was under XP but hey!). Thanks Tony :thumbsup:

        _ Offline
        _ Offline
        _AnsHUMAN_
        wrote on last edited by
        #3

        C:\Users\username\AppData could be just the place you are looking for.

        You talk about Being HUMAN. I have it in my name AnsHUMAN

        1 Reply Last reply
        0
        • S softwaremonkey

          Hi, Not sure if this question belongs here but I wondered if there is a location on the disk where I can gaurantee that I can always write a file to under Windows 7. In the good old days of XP I could use C:\ but thats a no-no (I guess it was under XP but hey!). Thanks Tony :thumbsup:

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          AppData it is. Get the path to this folder using the API SHGetSpecialFolderPath with CSIDL_APPDATA as the nFolder parameter.

          «_Superman_»  _I love work. It gives me something to do between weekends.

          _Microsoft MVP (Visual C++)

          Polymorphism in C

          S 1 Reply Last reply
          0
          • _ _Superman_

            AppData it is. Get the path to this folder using the API SHGetSpecialFolderPath with CSIDL_APPDATA as the nFolder parameter.

            «_Superman_»  _I love work. It gives me something to do between weekends.

            _Microsoft MVP (Visual C++)

            Polymorphism in C

            S Offline
            S Offline
            softwaremonkey
            wrote on last edited by
            #5

            Thanks guys that's great :thumbsup: :thumbsup:

            1 Reply Last reply
            0
            • S softwaremonkey

              Hi, Not sure if this question belongs here but I wondered if there is a location on the disk where I can gaurantee that I can always write a file to under Windows 7. In the good old days of XP I could use C:\ but thats a no-no (I guess it was under XP but hey!). Thanks Tony :thumbsup:

              S Offline
              S Offline
              Snorri Kristjansson
              wrote on last edited by
              #6

              Hi, Probably the best bet is to use [CommonApplicationData] folder (C:\ProgramData), one problem though - it's a hidden folder so users will have a problem finding it if they need to. Anyway... I was researching this same topic a few weeks ago. I thought I might share a few links to info regarding this subject: http://blogs.msdn.com/b/cjacks/archive/2008/02/05/where-should-i-write-program-data-instead-of-program-files.aspx[^] http://www.perceler.com/articles1.php?art=specfolder1[^] http://codefromthe70s.org/vistatutorial.aspx[^] http://www.wilderssecurity.com/showthread.php?t=282955[^] Allow write/modify access to CommonApplicationData[^] http://msdn.microsoft.com/en-us/library/aa905330.aspx[^]

              S 1 Reply Last reply
              0
              • S softwaremonkey

                Hi, Not sure if this question belongs here but I wondered if there is a location on the disk where I can gaurantee that I can always write a file to under Windows 7. In the good old days of XP I could use C:\ but thats a no-no (I guess it was under XP but hey!). Thanks Tony :thumbsup:

                J Offline
                J Offline
                jkirkerx
                wrote on last edited by
                #7

                I ran into that too last week on Windows 7, I ended up using Windows\Temp for now I tried Documents Setting\account\Application Data\My Folder but ran into issues with the long names, and file not found when pointing to config files I put in it.

                S 1 Reply Last reply
                0
                • S Snorri Kristjansson

                  Hi, Probably the best bet is to use [CommonApplicationData] folder (C:\ProgramData), one problem though - it's a hidden folder so users will have a problem finding it if they need to. Anyway... I was researching this same topic a few weeks ago. I thought I might share a few links to info regarding this subject: http://blogs.msdn.com/b/cjacks/archive/2008/02/05/where-should-i-write-program-data-instead-of-program-files.aspx[^] http://www.perceler.com/articles1.php?art=specfolder1[^] http://codefromthe70s.org/vistatutorial.aspx[^] http://www.wilderssecurity.com/showthread.php?t=282955[^] Allow write/modify access to CommonApplicationData[^] http://msdn.microsoft.com/en-us/library/aa905330.aspx[^]

                  S Offline
                  S Offline
                  softwaremonkey
                  wrote on last edited by
                  #8

                  Thanks for info and the links. It has made me realise that I should not take the lazy way out and need to do things properly. Good to see I am not on my own though :thumbsup:

                  1 Reply Last reply
                  0
                  • J jkirkerx

                    I ran into that too last week on Windows 7, I ended up using Windows\Temp for now I tried Documents Setting\account\Application Data\My Folder but ran into issues with the long names, and file not found when pointing to config files I put in it.

                    S Offline
                    S Offline
                    softwaremonkey
                    wrote on last edited by
                    #9

                    Hmmm windows\temp eh? Didn't think of that. I still think APPDATA is probably the best place (thanks AnsHUMAN and Superman. Tony :cool:

                    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