ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

AHK Script to create and delete a file until it is closed

(1/2) > >>

Zero3K:
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.

highend01:

--- ---#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
    }
}

Zero3K:
Thanks. And would removing the delete line from it make it overwrite the file after it is made or already exists?

highend01:
Nope

Zero3K:
Can you please make one that overwrites the file that is made?

Navigation

[0] Message Index

[#] Next page

Go to full version