; deletes rblx cookie file ; Replace 'black' below with your Windows username before using. #SingleInstance Force Persistent RobloxExes := [ "RobloxPlayerBeta.exe", "RobloxPlayerLauncher.exe", "RobloxStudioBeta.exe" ] LeftoverExes := [ "RobloxCrashHandler.exe", "RobloxPlayerLauncher.exe" ] ; Change your user here: CookieFile := "C:\Users\black\AppData\Local\Roblox\LocalStorage\RobloxCookies.dat" LogFile := A_ScriptDir "\FkRoblox.log" AllowElevation := true robloxRunning := false if (A_IsAdmin && HasCleanupFlag()) { TrayTip "Fk Roblox", "admin cleanup...", 3 Log("admin cleanup mode triggered") KillLeftovers() Sleep 2000 DeleteCookies(false) } SetTimer WatchRoblox, 1000 TrayTip "Fk Roblox", "running!", 3 Log("started | Admin=" A_IsAdmin) WatchRoblox() { global RobloxExes, robloxRunning running := false for exe in RobloxExes { if ProcessExist(exe) { running := true break } } if (running && !robloxRunning) { robloxRunning := true Log("Roblox launched") return } if (!running && robloxRunning) { robloxRunning := false Log("Roblox closed") KillLeftovers() Sleep 1000 DeleteCookies(true) } } KillLeftovers() { global LeftoverExes for exe in LeftoverExes { while ProcessExist(exe) { ProcessClose exe Sleep 200 } Log("closed: " exe) } } DeleteCookies(allowElevate := true) { global CookieFile, AllowElevation if !FileExist(CookieFile) { Log("cookie file not found") return } try attrib := FileGetAttrib(CookieFile) catch attrib := "(couldn't get attribs)" Log("deleting cookies, attrib=" . attrib) try { FileSetAttrib("-R-S-H", CookieFile) Log("attribs cleared") } catch { Log("FileSetAttrib failed on " . CookieFile) } Loop 5 { delException := "" try { FileDelete CookieFile Log("FileDelete tried, A_LastError=" . A_LastError) } catch { delException := "FileDelete exception" Log("FileDelete exception | A_LastError=" . A_LastError) } Sleep 300 if !FileExist(CookieFile) { TrayTip "Fk Roblox", "cookies deleted", 3 Log("deleted successfully") return } else { try attrib := FileGetAttrib(CookieFile) catch attrib := "(attrib fetch fail)" Log("couldn't delete; attrib=" . attrib . " | A_LastError=" . A_LastError . (delException ? " | ex=" . delException : "")) } try { tmp := CookieFile ".to_delete" FileMove CookieFile, tmp, 1 FileDelete tmp Log("tried move+delete (->" . tmp . ")") Sleep 200 if !FileExist(CookieFile) && !FileExist(tmp) { TrayTip "Fk Roblox", "cookies deleted (workaround)", 3 Log("deleted by move+delete") return } } catch { Log("move+delete failed | A_LastError=" . A_LastError) } try { Log("trying PowerShell fallback") RunWait 'powershell -Command "Remove-Item -Path \"' . CookieFile . '\" -Force"',, 'Hide' Sleep 250 if !FileExist(CookieFile) { TrayTip "Fk Roblox", "cookies deleted (PowerShell)", 3 Log("deleted by PowerShell fallback") return } } catch { Log("PowerShell fallback failed | A_LastError=" . A_LastError) } } Log("delete failed after all tries | Admin=" . A_IsAdmin . " | File still exists: " . FileExist(CookieFile)) if (allowElevate && AllowElevation && !A_IsAdmin) { TrayTip "Fk Roblox", "need admin – relaunching", 4 Log("relaunching as admin with cleanup flag") Run '*RunAs "' . A_ScriptFullPath . '" --cleanup' ExitApp } Log("ERROR: cookie file still exists after admin cleanup") } HasCleanupFlag() { for arg in A_Args { if (arg = "--cleanup") return true } return false } Log(msg) { global LogFile FileAppend "[" . A_Now . "] " . msg . "`n", LogFile }