Previous Topic: CreateFile - Create a New FileNext Topic: DeleteTree or DelTree - Remove a Directory Tree


DeleteFile or DelFile - Delete a File

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The DeleteFile or DelFile function removes the specified file.

This file content function has the format:

DeleteFile(filename as String) as Boolean
DelFile(filename as String) as Boolean
DeleteFile(filename as String, mode as Integer) as Boolean
DelFile(filename as String, mode as Integer) as Boolean
filename

Indicates the file name and path.

mode

Use on Windows only. The mode values are:

0 Delete file if not read-only

1 Delete file even if read-only

2 Deletion is delayed until next reboot

On successful completion, the function returns TRUE; otherwise, it returns FALSE.

Example: DeleteFile function

Rem
Rem By deleting the file Ncclient.ini a new workstation name detect 
Rem will be forced next time the Unicenter Asset Management agent is executed.
Rem 
DeleteFile(ComputerPath+"Ncclient.ini")
Rem ComnputerPath is an Unicenter Asset Management constant