Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Determine TEMP Directory

Keywords:   TEMP directory

Question:

How to you get the temp variable for where temp files are stored? I need to clean out that sub-directory. Most machines are c:\windows\temp but I don't want to assume anything.

Answer:

I generally....
temp=Environment("TEMP")
if temp==""
    temp=Environment("TMP")
endif
if temp==""
    temp="C:\TEMP\"
DirMake(temp)
endif
templen=strlen(temp)
if strsub(temp,templen,1)!="\"
    temp=strcat(temp,"\")
endif
Message("Temp Directory is",temp)

Article ID:   W12919
Filename:   Getting the Temp Directory.txt