Code: Select all
#SingleInstance Force
If !A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
Process, Priority, , High
s1 := A_ScriptDir
s2 := "C:\Users\Folder"
If FileExist("File.txt")
{
msgbox, File Exists. ; <------- The file.txt exists, so the script continues on.
}
Else
{
FileAppend, AUTOHOTKEY`n, %A_WorkingDir%\File.txt
return ; <-------- Since, the file don't exist, it'll have to make one. Afterwards, I want the entire script to just end there and close.
; The problem is, the script did NOT close here, it kept on going. What's wrong ?
}
checkname:
IF ( s1 = s2 )
{
RunWait, cmd.exe /c "taskkill /f /IM explorer.exe",, hide
Run, cmd.exe /c "c:\Windows\explorer.exe",, hide
InputBox, passcode, Enter your Passcode,, HIDE,, 100
if (passcode = "passcode") {
MsgBox, Yes
} else {
MsgBox, Try Again
gosub checkname
}
}