[python-win32] %TEMP% directory

le dahut le.dahut at laposte.net
Tue Jan 8 10:30:36 CET 2008


Thank you for this enlightenment. I've other question but I'll create 
another topic to keep things clear.

Tim Johnson a écrit :
> Actually I that's the normal behavior.  The TEMP environment variable is
> loaded by your user profile, but %TEMP% points to %WINDIR%\TEMP by default
> if it isn't set explicitly.  You can test this by running 'runas /noprofile
> /user:some_user cmd',  %TEMP% will point to %WINDIR%\TEMP.  Whatever script
> you're running is just running before the profile has finished loading.  You
> might want to add a second or two of delay or use a directory that you know
> is writeable by the user.
> 
> On Jan 8, 2008 12:32 AM, le dahut <le.dahut at laposte.net> wrote:
> 
>> No it is not, it is a fresh installed XP, and the same problem occurs on
>> undreds of machines running XP and 2k. But I forgot to precise that once
>> the session is opened and the desktop is completely loaded, %TEMP%
>> points to the correct directory (C:\Doc & Settings\<user>\...\temp).
>>
>> This strange behaviour occurs only at logon. If someone has any ideas or
>> addresses where I can find some ideas ?
>>
>> Tim Roberts a écrit :
>>> le dahut wrote:
>>>> I've a strange behavior with windows XP, %TEMP% points to %WINDIR%\TEMP
>>>> instead of "C:\Documents and Settings\<USERNAME>\Local Settings\Temp"
>> at
>>>> logon time. Since I have a program that uses temp files it can write
>>>> there when a non-admin user logs on so it failed with traceback etc.
>>>>
>>>> Why ? Is there a KB article about that ?
>>>>
>>> This is almost certainly a machine that used to run Windows 9X, and was
>>> upgraded in place to XP.  On 9X, there was no "Documents and Settings"
>>> directory, so temp files went into \Windows\TEMP, and the XP upgrade
>>> process tries to maintain that.
>>>
>>> I would think that MANY things would fail if %TEMP% were not writable.
>>>
>>> You could fall back to %USERPROFILE%\Local Settings\Temp, I suppose.
>>>
>>  _______________________________________________
>> python-win32 mailing list
>> python-win32 at python.org
>> http://mail.python.org/mailman/listinfo/python-win32
>>
> 
> 
> 


More information about the python-win32 mailing list