Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH: how to get dfault TEMP dir
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00394247
Message ID:
00580846
Views:
38
(waiting for George to slap me for not trying harder with WSH)

This works:
Clear
iOld =  Set("MemoWidth")
Set Memowidth To 4096
oShell = CreateObject("WScript.Shell")
oSysEnv = oShell.Environment("SYSTEM")
? oSysEnv.Item("Temp")
? oSysEnv.Item("Tmp")
? oSysEnv.Item("Path")
Set Memowidth To (iOld)
*For Each Thing in oSysEnv
*	? Thing
*Next
On the systems I am working with, there are user temp settings in "c:\documents and settings" but the OS temp folder is "z:\" (a RAMDisk), and I wanted to use the system one for all my out-of-process objects. Running the above code gives me "z:\" and not something user-centric.

Thanks!




>>>The user Temp folder is the Windows Temp folder for all intents and purposes, although the content of the system process' TEMP environment variable may be different than the TEMP variable in the current user context. You can always fall back on the GetTempPath() API call:
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform