Solved

Auto-deleting file

Posted on 1999-01-07
2
131 Views
Last Modified: 2010-04-04
How to write an app that will delete itself
on exit.
0
Comment
Question by:ILPowerSoft
2 Comments
 

Accepted Solution

by:
ptiemann2 earned 20 total points
ID: 1355147
Hi, see my technical tip at
http://www.preview.org/q/q2074.shtml

Never mind.. I just copy it here:

Both Windows 95 and NT provide mechanisms for doing just this.

Under Win95 you use the WinInit.ini file. Create a [rename] section and put in entries like "NewName.txt=OldName.txt" to have files renamed, or "nil=OldName.txt" to have them deleted. Windows will perform this at the next boot.

Under Windows NT, the MoveFileEx function has a parameter that allows you to defer the move (or delete) until the next boot. It stores the list of files to be processed in the registry.

To determine whether NT or 95/98.. use GetVersion() - how to do it, see this:

http://www.preview.org/q/q1012.shtml

Good luck,
Peter



0
 

Author Comment

by:ILPowerSoft
ID: 1355148
Thanx, this is it
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

948 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

20 Experts available now in Live!

Get 1:1 Help Now