Andromo - Start Making Apps - Free Signup

Announcement

Collapse
No announcement yet.

Session Variable for Windows "Default User" folder?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Session Variable for Windows "Default User" folder?

    I need to store some files in the "Default User" folder of Windows so that any new users added to the system will have those files included in their new user profile.

    However, whilst there are Session Variables for things such as "My Documents" (%MyDocumentsFolder%) and "\All Users\Documents" (%CommonDocumentsFolder%), I can not find a Session Variable for the "Default User" folder.

    Assuming Drive C:, the folder in question would be "C:\Documents and Settings\Default User" for Windows XP, and "C:\Users\Default" for Windows Vista.

    Is there such a Session Variable? Or, if not, what would be the best way to "construct" this folder location using other variables such as "%SystemDrive%" etc?

    Any help appreciated.

  • #2
    Originally posted by freddy View Post
    I need to store some files in the "Default User" folder of Windows so that any new users added to the system will have those files included in their new user profile.

    However, whilst there are Session Variables for things such as "My Documents" (%MyDocumentsFolder%) and "\All Users\Documents" (%CommonDocumentsFolder%), I can not find a Session Variable for the "Default User" folder.

    Assuming Drive C:, the folder in question would be "C:\Documents and Settings\Default User" for Windows XP, and "C:\Users\Default" for Windows Vista.

    Is there such a Session Variable? Or, if not, what would be the best way to "construct" this folder location using other variables such as "%SystemDrive%" etc?

    Any help appreciated.

    Construct it by commondocumentsfolder%\\..\\..\\defaultuser

    Comment


    • #3
      Originally posted by jassing View Post
      Construct it by commondocumentsfolder%\\..\\..\\defaultuser
      Wow. That seems so obvious. It's almost embarrassing I didn't think of it myself. Thanks jassing. I'll give that a try.
      .
      Last edited by freddy; 09-26-2008, 04:37 PM.

      Comment


      • #4
        Originally posted by freddy View Post
        Wow. That seems so obvious. It's almost embarrassing I didn't think of it myself. Thanks jassing. I'll give that a try.
        .
        command line, windows, it's the file system at heart
        single '.' means "this directory

        so "dir ." is the same as "dir" as it defaults to the current directory
        ".." means "parent directory" -- you can use it in windows, anything that uses the file system. it's also used in unix/linux... whenever you want the "directory above" that's ".." and you can use them multiple times to "walk" the tree..

        Comment


        • #5
          Hehe, yep, born and bred on PCs as early as the 80s, I've done my fair share of DOS stuff over the years. Even today I am constantly in the command prompt doing things and getting the jobs done. In a lot of cases Windows seems to be merely a pretty background utility. So I am familiar with the "." and ".." stuff. For example, I can't recall how many times in my life I would have typed "cd.." <Enter>. Hence my statement that it's almost embarrassing I didn't think of what you suggested myself.

          Thanks again. I am yet to test it out, but on the surface there's no reason for it not to work.
          .
          Last edited by freddy; 09-28-2008, 06:08 PM.

          Comment


          • #6
            Originally posted by freddy View Post
            I am yet to test it out, but on the surface there's no reason for it not to work.
            .
            It will -- I've used that in scripts (lua) GUI's (VB, VFP, etc) and in C/C++ -- works fine in "windows" too.

            Comment

            Working...
            X