WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Environment

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 2002:10:08:08:38:08
Last Updated: 2002:10:08:08:38:08