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

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..
KingSencatAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark_FreeSoftwareCommented:
add a button

then paste this code:


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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
Private Sub Command1_Click()
    Kill "c:\example.exe"
End Sub
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Mark_FreeSoftwareCommented:

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

i think that is the first time ;)
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
=(

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






Just kidding...  =)
Mark_FreeSoftwareCommented:

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

you learned basic before i was even born >.<
KingSencatAuthor Commented:
Please help in the other 2 of my questions
KingSencatAuthor Commented:
I cant delete the file because its already running at TASK MANAGER ... how can i end the process ( not manually )
Mark_FreeSoftwareCommented:
let me guess, explorer.exe?
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
Are you trying to make an EXE delete itself?
KingSencatAuthor Commented:
No is not explorer.exe ....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.