Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 496
  • Last Modified:

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
0
daneburr
Asked:
daneburr
1 Solution
 
Wayne Taylor (webtubbs)Commented:
Kill Environ("VAPATH") & "test.txt"

Wayne
0
 
daneburrAuthor Commented:
Answered REAL FAST!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now