Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2007
    Posts
    12

    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. #2
    Join Date
    Jan 2001
    Location
    Shelton,WA
    Posts
    3,123
    Quote 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

  3. #3
    Join Date
    Jul 2007
    Posts
    12
    Quote 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 at 05:37 PM.

  4. #4
    Join Date
    Jan 2001
    Location
    Shelton,WA
    Posts
    3,123
    Quote 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..

  5. #5
    Join Date
    Jul 2007
    Posts
    12
    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 at 07:08 PM.

  6. #6
    Join Date
    Jan 2001
    Location
    Shelton,WA
    Posts
    3,123
    Quote 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.

Similar Threads

  1. How do Session Variables work?
    By Adam in forum Setup Factory 8.0 FAQ
    Replies: 0
    Last Post: 04-28-2008, 01:15 PM
  2. multiple locations.
    By wasim21k in forum AutoPlay Media Studio 6.0
    Replies: 15
    Last Post: 04-04-2007, 10:43 AM
  3. Eearliest point to initialize custom session variable
    By Se7en in forum Setup Factory 7.0
    Replies: 0
    Last Post: 03-15-2006, 09:12 AM
  4. cookies
    By goukilord10 in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 05-20-2005, 05:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts