?
Solved

Auto-deleting file

Posted on 1999-01-07
2
Medium Priority
?
137 Views
Last Modified: 2010-04-04
How to write an app that will delete itself
on exit.
0
Comment
Question by:ILPowerSoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
ptiemann2 earned 80 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

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!

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 9 hours left to enroll

765 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