How to delete a file, with path set in Environment Variables, using Visual Basic 6 VB6?

I have a system variable in Environment Variables set to:
Variable:
VAPATH
Value:
z:\test\vbapps\

As an example I am trying to delete a file z:\test\vbapps\test.text
I know my Environment Variable is fine because I can open it in RUN using:
%vapath%\test.txt

This doesn't work....
Private Sub Command1_Click()
Kill ("%vapath%\test.txt")
End Sub

I am using Visual Basic 6(VB6) and WinXP pro
daneburrAsked:
Who is Participating?
 
Wayne Taylor (webtubbs)Connect With a Mentor AstronautCommented:
Kill Environ("VAPATH") & "test.txt"

Wayne
0
 
daneburrAuthor Commented:
Answered REAL FAST!
0
All Courses

From novice to tech pro — start learning today.