(AGK version: 108.13)
Submitted: 2013-06-21 15:15:59
Setvirtualresolution(640,480)
SetPrintSize(25)
ResetTimer()

//Create a test file
file$="agktest.txt"
OpenToWrite(1,file$)
WriteLine(1,"AGK rules!")
CloseFile(1)

Repeat
    Print ("Test file created,")
    Print ("it will be deleted in 15 seconds")

    Sync()
Until Timer()>15

//Delete the original test file
DeleteFile(file$)
End
(AGK version: 2.0.14)
Submitted: 2015-08-06 09:06:59
hint/workaround:
if u need a new directory after deleteing a file
with GetFirstFile & GetNextFile
maybe try this before, it updates the list
SetFolder("")
SetFolder("media")
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.