Windows Code Module to Delete Files

ID: Q96789


The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1


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. Click the file names below to download the files:


Deltest.exe

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address

http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

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.

Additional query words: softlib DELTEST.EXE kbDSupport

Keywords : kbfile kbsample kb16bitonly kbWinOS310 kbWinOS300
Version : WINDOWS:3.0,3.1
Platform : WINDOWS
Issue type :


Last Reviewed: December 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.