Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

my documents folder under WinXP 2

Status
Not open for further replies.

rob444

Programmer
Nov 5, 2002
633
NL
How to get the my documents folder under windows xp, a directory that is different for every different user.

I've been looking at the faq's but I haven't found the proper solution yet...

I use vfp6,7,8 and 9

Rob.
 
Rob,
It's easy in WSH:
Code:
WshShell = CreateObject("WScript.Shell")
? WshShell.SpecialFolders(10)
More specificly you can get to "all" the special Windows folders:
Code:
*!*	 0: All Users \ Desktop
*!*	 1: All Users \ Start Menu
*!*	 2: All Users \ Start Menu \ Programs
*!*	 3: All Users \ Start Menu \ Programs \ Startup
*!*	 4: Current User \ Desktop
*!*	 5: Current User \ Application Data
*!*	 6: Current User \ Printhood
*!*	 7: Current User \ Templates
*!*	 8: Fonts
*!*	 9: Current User \ Nethood
*!*	10: Current User \ Desktop
*!*	11: Current User \ Start Menu
*!*	12: Current User \ SendTo
*!*	13: Current User \ Recent
*!*	14: Current User \ Start Menu \ Programs \ Startup
*!*	15: Current User \ Favorites
*!*	16: Current User \ My Documents
*!*	17: Current User \ Start Menu \ Programs

WshShell = CreateObject("WScript.Shell")
FOR lnii = 0 TO 17
  ? TRANSFORM(lnii,"99")+": "+WshShell.SpecialFolders(lnii)
ENDFOR
Rick

 
rob444,

I wrote a FAQ on getting the windows special folders, three different solutions including two different API calls and one using a scripting example similar to the one Rick posted above...

Get Path To Windows Special Folders (such as Desktop)
faq184-4264


boyd.gif

 
Thanks Craig,

A star for you too!

Rob.
 
This might get you where you need to be too.

?GETENV("TMP")

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top