Solved

Auto-deleting file

Posted on 1999-01-07
2
130 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
Comment Utility
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
Comment Utility
Thanx, this is it
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

11 Experts available now in Live!

Get 1:1 Help Now