Solved

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

Posted on 2011-02-26
2
475 Views
Last Modified: 2012-05-11
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
Comment
Question by:daneburr
2 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 250 total points
Comment Utility
Kill Environ("VAPATH") & "test.txt"

Wayne
0
 

Author Closing Comment

by:daneburr
Comment Utility
Answered REAL FAST!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

744 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

18 Experts available now in Live!

Get 1:1 Help Now