{NeoBook Function}
Version=5.80
Language=VBScript
Comment=Locks a file by opening it exclusively - By Neodude
Param=[%1]|Text|File path (example - C:\folder\filename.txt)
Param=[%2]|Text|Unlock variable(If u set this to True, file will unlock)
{End}
Const ForAppending = 8
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set f = oFSO.OpenTextFile("a.txt", ForAppending, True)
dim shouldExit

Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")

Do While True
	shouldExit = publication.nbGetVar("[%2]")
    If shouldExit = "True" Then
        publication.nbSetVar "[%2]", "False"
        'MsgBox "Exiting"
        Exit Do
    Else
        WSHShell.run "ping -n 2 127.0.0.1", hidden
    End If
Loop
