Solved

Query NT 4 to find %tmp% path

Posted on 1999-01-15
4
208 Views
Last Modified: 2010-05-03
how can I find out what the tmp path is on any given  NT machine.

I have a program that writes to a tmp file so I need to
put this file in %tmp%.

Is there a win32 api call?
0
Comment
Question by:gre
4 Comments
 
LVL 2

Accepted Solution

by:
ginde earned 20 total points
ID: 1456683
If you are using NT 4.0, there should be environment variables TMP and TEMP. You can get their values using Environ("TEMP") function.

0
 
LVL 3

Expert Comment

by:vikiing
ID: 1456684
One comment: If Environ("TEMP") returns a null string, that system variable (temp) is not defined.

0
 
LVL 1

Expert Comment

by:muffinthedog
ID: 1456685
Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Const MAX_PATH = 256
Function TmpPath() as String
Dim strTemp As String * MAX_PATH
GetTempPath MAX_PATH, strTemp
TmpPath = Left(strTemp, InStr(strTemp, Chr(0)) - 1)
End Function
0
 

Author Comment

by:gre
ID: 1456686
thx
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now