View Full Version : Session Variable for Windows "Default User" folder?
freddy
09-25-2008, 07:39 PM
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.
jassing
09-26-2008, 10:45 AM
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
freddy
09-26-2008, 05:32 PM
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.
.
jassing
09-26-2008, 09:57 PM
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..
freddy
09-28-2008, 06:59 PM
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.
.
jassing
09-28-2008, 07:10 PM
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.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.