[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB6.0 When i am clicking at button to delete a file c:\example.exe

Posted on 2006-04-17
13
Medium Priority
?
228 Views
Last Modified: 2011-09-20
Hello Experts!! newbie here ...
 
I am using VB6.0 and i want  When i am clicking at button to delete a file c:\example.exe ... so simple i think please
paste me the source..
0
Comment
Question by:KingSencat
  • 5
  • 4
  • 4
13 Comments
 
LVL 13

Accepted Solution

by:
Mark_FreeSoftware earned 1500 total points
ID: 16473364
add a button

then paste this code:


Private Sub Command1_Click()
Kill "c:\example.exe"
End Sub


0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16473370
Private Sub Command1_Click()
    Kill "c:\example.exe"
End Sub
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16473379
It would be a good idea to put some error trapping in there just in case...

Private Sub Command1_Click()
    On Error GoTo failure
    Kill "c:\example.exe"
    Exit Sub
   
failure:
    MsgBox Err.Description, vbCritical, "Delete Failed"
End Sub
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:Mark_FreeSoftware
ID: 16473406

heh beat you to it in less than a minute :P

i think that is the first time ;)
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16473424
=(

Quit being mean to me...I think I'll quit EE now!






Just kidding...  =)
0
 
LVL 13

Expert Comment

by:Mark_FreeSoftware
ID: 16473453

it is not fair, you do have an unfair advantage on (over?) me

you learned basic before i was even born >.<
0
 

Author Comment

by:KingSencat
ID: 16473474
Please help in the other 2 of my questions
0
 

Author Comment

by:KingSencat
ID: 16473523
I cant delete the file because its already running at TASK MANAGER ... how can i end the process ( not manually )
0
 
LVL 13

Expert Comment

by:Mark_FreeSoftware
ID: 16473557
let me guess, explorer.exe?
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16473573
Are you trying to make an EXE delete itself?
0
 

Author Comment

by:KingSencat
ID: 16473599
No is not explorer.exe ....
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
Suggested Courses

834 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