Now its just being stupid. I logged off the account and changed permissions on the file then logged back into it and it doesnt give the "error opening the file" error. I ran this script and it worked fine with not errors. Why is it not working??? The second script is the one that isn't workng
$time = IniRead("C:\Program Files\Timer\config.txt", "default", "time", "0")
if $time = 0 then
MsgBox(4096, "Result", "time not found")
endif
$file = fileopen("C:\Program Files\Timer\timer.txt", 2)
filewrite($file, $time)
fileclose($file)
$time = IniRead("C:\Program Files\Timer\config.txt", "default", "time", "0")
If $time = 0 Then MsgBox(4096, "Result", "time not found")
$file = FileOpen("C:\Program Files\Timer\timer.txt", 2)
If $file <> "-1" Then
FileWrite($file, $time)
FileClose($file)
Else
MsgBox( 0, "", "Error opening the file" )
EndIf
FileWrite($file, $time)
FileClose($file)