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:
00580852
Views:
34
>(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!
>
Steve,

No slaps from me. Nice solution using the WSH. However, and I knew this was a familiar topic, I'd check out the GetTempPath(). There's a difference between the way this information is validated and returned between the Win9x/Me platform and WinNT/2K/XP. These differences are explained in the Platform SDK:File Storage section. This could impact the results you get with the WSH.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform