Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 7th, 2003, 11:55 PM
aryan_ht aryan_ht is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 1 aryan_ht User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
itself deletion!!!

Hi,

How can a file delete itself??? Is it possible?...

A friend helped me by shell function:
'''''''''''''
Private Sub Command1_Click()
Dim file as String

file = App.Path
If Right(file, 1) <> "\" Then file = file & "\"
file = file & App.EXEName & ".exe"
Call Shell("start /m /w deltree /y " & file, vbHide)
End

End Sub

' Dont really need the /m
' or /w




'''''''''''
but it didn't work on 2K and XP OS. maybr the problrm with start.
Any help?

Best Regards,

Reply With Quote
  #2  
Old April 8th, 2003, 03:58 AM
Wingman Wingman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Bavaria, Germany
Posts: 140 Wingman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 40 m 41 sec
Reputation Power: 6
Hehe, nice virus you're writing ;-) No, you can't delete your binary file within the scope of your binary since the operating system locks it.

A work-around would be to start your .exe in a .bat file like this:

test.bat:

Code:
  myExe.exe
  del myExe.exe

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > itself deletion!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT