If FileExists(@DesktopDir & "\1.txt") Then
FileDelete(@DesktopDir & "\1.txt")
EndIf可以用FileExists判断文件是否存在再用FileDelete删除文件上面的例子是判断当前用户桌面是否存在1.txt文件如果存在则删除
这是基础操作函数,给你个chm学习手册,还有举例,见附件.
$myFile = "文件全路径" ;例如D:\test.txt
If FileExists($myFile) Then
FileDelete($myFile)
EndIf