Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding out Fullpath of Documents & Settings special folder
Hello All,
I am trying to put all the names of the different user folders on a computer into an array. On most computers, these are located in the C drive in this folder:

Copy      Help
C:\Documents and Settings\

so my code looks like this
Copy      Help
ARRAY(str) ArrayAllUsers.create(200)
int i
Dir d
foreach(d "C:\Documents and Settings\*" FE_Dir 0x1)
,str sPath=d.FileName(1)
,sPath.replacerx("C:\\Documents and Settings\\" "")
,sel sPath; case ["NetworkService","LocalService","All Users"]; continue
,;out sPath
out ArrayAllUsers

However, on some computers this is set up on D: drive instead of C:
Is there any Special Folder name e.g. something like "$Documents and Settings$\" that I could just put in my code to make it work under either circumstance?.
Macro Macro1724
Copy      Help
_s.expandpath("$User Profile$")
out _s
Quote:s.getpath([file] [append])
s.getfilename([file] [ext])

so helpfull!!!. I have been doing a lot of string manipulation for these steps...can't believe I didn't know about these functions!!!

Forum Jump:

Users browsing this thread: 1 Guest(s)