Search

Kill function sample codes

Deletes files from a disk. The example below uses .txt file but you may replace with any file types.

Kill MacID("C:\Users\LP\AppData\Local\Temp\TestFile.txt")

If you use the MacID function with Kill in Microsoft Windows, an error occurs. An error also occurs if you try to use Kill to delete an open file.

' Assume TESTFILE is a file containing some data.
Kill "C:\Users\LP\AppData\Local\Temp\TestFile.txt" ' Delete file. 

 

' Delete all *.TXT files in the current directory.
Kill "C:\Users\LP\AppData\Local\Temp\*.TXT


No comments:

Post a Comment

Note: only a member of this blog may post a comment.