The usual way to determine the Windows’ main directory is based on the GetTempPath API function, which requires that you set up a buffer for the result, and then extract the null-terminated result. However, there is a much simpler approach, that works equally well under Windows 95, 98 and NT. It is based on the fact that either the TMP or TEMP environment variables (or both of them) already holds the path to that directory, so you just need a single line of code:
tempPath = IIf(Environ$("tmp") <> "", Environ$("tmp"), Environ$("temp"))
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.























