The removefile command is used to delete files.
When a file is no longer needed, use the removefile command to delete the file. It is necessary to use the full path of the file. The syntax is as follows:
removefile("filename");
The removefile command does not take any options.
In the following example, we will use removefile to delete the sample file we used in the other examples on file operations. The code would be as follows:
removefile("file2.txt");
The file is now deleted.