It would be nice if someone could make one that fills a file (in the root directory) with the word Dummy and deletes it then repeats the process until it is closed.
#NoEnv
#SingleInstance force
SetWorkingDir %A_ScriptDir%
FileEncoding UTF-8
SetBatchLines, -1
drive := "C:\"
file := "Dummy.txt"
path := drive . file
text := "Dummy"
if FileExist(drive) {
Loop {
if FileExist(path)
FileDelete, % path
FileAppend, % text, % path
}
}#NoEnv
#SingleInstance force
SetWorkingDir %A_ScriptDir%
FileEncoding UTF-8
SetBatchLines, -1
drive := "C:\"
file := "Dummy.txt"
path := drive . file
text := "Dummy"
if FileExist(drive) {
Loop {
EmptyFile(path)
FileAppend, % text, % path
}
}
EmptyFile(file) {
hFile := DllCall("CreateFile", Str, file, UInt, 0x40000000, UInt, 3, UInt, 0, UInt, 5, UInt, 0, UInt, 0)
DllCall("CloseHandle", UInt, hFile)
return hFile > 0 ? 1 : hFile
}Original address: https://www.donationcoder.com/forum/index.php?topic=48388.0