Sign in to follow this  
Followers 0
Jango

Help needed with @TempDir

2 posts in this topic

#1 ·  Posted (edited)

Hello,

I'm using the macro @TempDir to write a log file in various script, for one of this script i noticed the log was not created then i added a msgbox to see what happened, here is the code:

Global $LOGFILE = @TempDir & "\NET-smb.log"
.
.
.
If Not FileExists($UPDATE_PATH & "\" & $UPDATER) Then
    MsgBox(0, "", "3.2 " & $LOGFILE & " " & $UPDATE_PATH & "\" & $UPDATER & " not found check the path")
    _FileWriteLog($LOGFILE, $UPDATE_PATH & "\" & $UPDATER & " not found check the path")
    Exit(1)
EndIf

In fact my log file is created but in C:\Windows\TEMP ??? and NOT in the path of the EnvVar %Temp% .... why ? For me the @TempDir must be equal %Temp%

EDIT:

When i do in a dos box: echo %Temp% i get C:\Users\xxxx\AppData\Local\Temp

And i tested EnvGet("TEMP") i get C:\Windows\TEMP ... i don't understand

Edited by Jango

Share this post


Link to post
Share on other sites



Sorry but in the same time i found what happen. I run my program with RunAsWait with option interactive no profile then AutoIt take the SYSTEM ENVVAR %Temp% wich is C:\Windows\Temp

I think this post could be intresting to others anyway.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0