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.
<br><br>
<div class="gmail_quote">On Jan 8, 2008 12:32 AM, le dahut <<a href="mailto:le.dahut@laposte.net">le.dahut@laposte.net</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">No it is not, it is a fresh installed XP, and the same problem occurs on<br>undreds of machines running XP and 2k. But I forgot to precise that once
<br>the session is opened and the desktop is completely loaded, %TEMP%<br>points to the correct directory (C:\Doc & Settings\<user>\...\temp).<br><br>This strange behaviour occurs only at logon. If someone has any ideas or
<br>addresses where I can find some ideas ?<br><br>Tim Roberts a écrit :<br>
<div class="Ih2E3d">> le dahut wrote:<br>>> I've a strange behavior with windows XP, %TEMP% points to %WINDIR%\TEMP<br>>> instead of "C:\Documents and Settings\<USERNAME>\Local Settings\Temp" at
<br>>> logon time. Since I have a program that uses temp files it can write<br>>> there when a non-admin user logs on so it failed with traceback etc.<br>>><br>>> Why ? Is there a KB article about that ?
<br>>><br>><br>> This is almost certainly a machine that used to run Windows 9X, and was<br>> upgraded in place to XP. On 9X, there was no "Documents and Settings"<br>> directory, so temp files went into \Windows\TEMP, and the XP upgrade
<br>> process tries to maintain that.<br>><br>> I would think that MANY things would fail if %TEMP% were not writable.<br>><br>> You could fall back to %USERPROFILE%\Local Settings\Temp, I suppose.<br>><br>
</div>
<div>
<div></div>
<div class="Wj3C7c">_______________________________________________<br>python-win32 mailing list<br><a href="mailto:python-win32@python.org">python-win32@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">
http://mail.python.org/mailman/listinfo/python-win32</a><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>_____________________<br>Ceci n'est pas un email.