Quote:
$iif(writeini -n $scriptdirmyfile.ini Login Status == ON, ...)


That is not a valid if-statement. See /help $readini instead.