Solved

Query NT 4 to find %tmp% path

Posted on 1999-01-15
4
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month3 days, 23 hours left to enroll

630 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