|
-
Aug 6th, 2009, 05:07 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Get a program to delete its self and close
Ok how do i get my program to delete its self? Because when i do Kill or My.Computer.FileSystem.DeleteFile the Access is denied because its still running. So how do i get it to delete its self
-
Aug 6th, 2009, 07:30 PM
#2
Re: Get a program to delete its self and close
i could think of a way, but it just seems odd that previously you wanted to disconnect a remote computer, and now you want a program to delete itself... i dunno.. im still seeing red flags.
what are you trying to accomplish as an end goal here?
-
Aug 6th, 2009, 07:40 PM
#3
Member
Re: Get a program to delete its self and close
In the spirit of you breaking something so we all get paid to fix it... Write out a .bat file which deletes the executable path directory and set that batch file to run on system boot, then shutdown the computer
Same thing..and fun
-
Aug 6th, 2009, 07:59 PM
#4
Re: Get a program to delete its self and close
It does seem odd, but just as an academic exercise I would suggest the use of a batch file triggered in the application_exit event which would wait for approximately 5 seconds before deleting the program file.
-
Aug 6th, 2009, 08:14 PM
#5
Re: Get a program to delete its self and close
actually i have done this before in vb6 - same will apply for .net tho ... create the bat file that looks kinda like the following from with in your project:
Code:
:StartOver
del myApp.exe
IF EXIST myApp.exe GOTO StartOver
del thisbat.bat
Then run the bat from your interface:
Code:
Shell("delme.bat", AppWinStyle.Hide)
then close your app
-
Aug 7th, 2009, 12:13 AM
#6
Fanatic Member
Re: Get a program to delete its self and close
You should use this code in .NET
vb.net Code:
Process.Start("delete_me")
-
Aug 7th, 2009, 12:41 AM
#7
Hyperactive Member
Re: Get a program to delete its self and close
Is there a specific reason for wanting to do this?
I can only think of one: A destructive application that deletes files, folders, or worse, then removes itself to hide its tracks.
-
Aug 7th, 2009, 06:34 AM
#8
Thread Starter
Fanatic Member
Re: Get a program to delete its self and close
-
Aug 7th, 2009, 08:30 AM
#9
Fanatic Member
Re: Get a program to delete its self and close
It doesn't make much sense why an uninstaller would delete itself after it does it job. I'm seeing red flags...
@Seraph: Ahahahaha, yeah, lol. Now that I think it true, DUH! Lol. Anyhow, what I was trying to imply is that it sounds kind of weird.
Last edited by tassa; Aug 7th, 2009 at 08:59 AM.
-
Aug 7th, 2009, 08:55 AM
#10
Fanatic Member
Re: Get a program to delete its self and close
tassa: errr...Uninstallers always delete themselves. lol
Well, in theory this program wants to log someone off a computer remotely.
Emcrank already said he owns the connection.
He will need credentials of the target PC to be able to do this.
And, how malicious can it be when after it deletes itself, you can get right back on.
The whole things sounds fishy to me too, but not sure what all that will accomplish.
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Aug 7th, 2009, 09:55 AM
#11
Re: Get a program to delete its self and close
really? I've never had an installer delete itself... the app sure... but the install file is always still there.... good thing too... sometimes I uninstall an app so I can reinstall it... the msi file doesn't disappear when I finish.
-tg
-
Aug 7th, 2009, 09:58 AM
#12
Fanatic Member
Re: Get a program to delete its self and close
If you have a program that doesn't have the installer and uninstaller in the same executable it does. Like with INNO installer, the installer installs the program, and during installation it creates an uninstaller with specific instructions for deleting anything you flagged in INNO to uninstall (e.g. Registry keys that were created during the istallation, etc. And, in the end, the uninstaller is deleted as well since it is just that, an uninstaller; nothing else.
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Aug 7th, 2009, 02:48 PM
#13
Re: Get a program to delete its self and close
seems like he would've said "I am trying to uninstall my program and I would like the uninstaller to be deleted as well. How can I accomplish this?"
getting a program to close itself and delete sounds a bit different to me
-
Aug 7th, 2009, 02:56 PM
#14
Fanatic Member
Re: Get a program to delete its self and close
Except that he called it an uninstaller after the fact. lol.
I know, it still seems shady, but we don't know much about it.
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Aug 7th, 2009, 02:57 PM
#15
Re: Get a program to delete its self and close
so we should wait for him to provide some detailed information before throwing all these ideas at him.
-
Aug 7th, 2009, 03:06 PM
#16
Fanatic Member
Re: Get a program to delete its self and close
Then let's ask more straightforward. lol
Emcrank, what exactly is your program supposed to accomplish?
It seems no one here is willing to help because what you have described, thus far, seems a tad bit shady. (And I don't blame anyone for that; I'm thinking it's fishy too.)
And your reluctance to be forthcoming with the purpose of your program isn't helping either. Normally, when people have asked questions and sounded shady, they were willing to speak up and explain their true intent when confronted.
It seems you might get a better reception and more help in this issue if you were to just make everyone happy and let us know what exactly this whole program is supposed to do.
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Aug 7th, 2009, 04:08 PM
#17
Thread Starter
Fanatic Member
Re: Get a program to delete its self and close
I Completly scrapped the thing about the disconnecting the internet it was to hard for me.
Anyway all i want is an uninstaller to uninstall my program and then uninstall its self so there is nothing left about it. Okay?
-
Aug 7th, 2009, 04:13 PM
#18
Fanatic Member
Re: Get a program to delete its self and close
INNO Setup.
You can create an installer for your program, and it automatically creates an uninstaller for it.
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Aug 7th, 2009, 04:16 PM
#19
Thread Starter
Fanatic Member
Re: Get a program to delete its self and close
-
Aug 7th, 2009, 09:14 PM
#20
-
Aug 7th, 2009, 10:33 PM
#21
Re: Get a program to delete its self and close
-
Aug 7th, 2009, 11:14 PM
#22
Fanatic Member
Re: Get a program to delete its self and close
 Originally Posted by storm5510
Various Downloads Very Handy For Renegade Users
This is from his web site. You all do what you want. I'm done here.

oops lol
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Aug 8th, 2009, 06:16 AM
#23
Thread Starter
Fanatic Member
Re: Get a program to delete its self and close
What do you mean oops lol whats wrong with it?
-
Aug 8th, 2009, 09:14 AM
#24
Fanatic Member
Re: Get a program to delete its self and close
He was thinking you meant hacking and stateofidleness was making it clear renegade referred to Command and Conquer. lol
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Aug 8th, 2009, 04:02 PM
#25
Thread Starter
Fanatic Member
Re: Get a program to delete its self and close
Oh.. Lol i shud have changed it to C&C Renegade
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|