Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding out Fullpath of Documents & Settings special folder
#1
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:

Code:
Copy      Help
C:\Documents and Settings\

so my code looks like this
Code:
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
,ArrayAllUsers[i]=sPath
,i=i+1
ArrayAllUsers.redim(i)
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?.
THanks,
S
#2
Macro Macro1724
Code:
Copy      Help
_s.expandpath("$User Profile$")
_s.getpath
out _s
#3
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!!!
Thanks,
S


Forum Jump:


Users browsing this thread: 1 Guest(s)