Help and Support

Windows Code Module to Delete Files

Article ID:96789
Last Review:August 4, 2004
Revision:3.1
This article was previously published under Q96789

SUMMARY

The DELTEST sample contains a complete code module to delete one or more files by using wildcards. The sample also demonstrates how to use wildcards to search through an entire directory.

MORE INFORMATION

The following files are available for download from the Microsoft Download Center:


Deltest.exe (http://download.microsoft.com/download/platformsdk/sample11/3.1/w31/en-us/deltest.exe)

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 (http://support.microsoft.com/kb/119591/EN-US/) How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

The C Run-time contains a function to delete one file, but does not allow a program to delete multiple files using wildcard characters. The DELETE.C module included with this sample can be used with any application or dynamic-link library (DLL) to perform this operation. This module uses the _dos_findfirst/next functions in conjunction with the remove() function to allow multiple files to be erased.

NOTE: In the sample, if "Delete tmp Files" is selected from the menu, the two .TMP files included with the sample will be erased.

For information on how to call the Delete() function, please refer to the comment block inside of DELETE.C.

APPLIES TO
Microsoft Windows Software Development Kit 3.0
Microsoft Windows Software Development Kit 3.1

Back to the top

Keywords: 
kb16bitonly kbfile kbsample KB96789

Article Translations

 

Other Support Options

  • Contact Microsoft
    Phone Numbers, Support Options and Pricing, Online Help, and more.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.