本帖最后由 半芯竹 于 2012-1-10 00:46 编辑 $mypath = @AutoItExe
$redreg=RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "uptime")
If $redreg Then
If $redreg<>@AutoItExe Then
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "uptime","REG_SZ", $mypath)
EndIf
Else
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "uptime","REG_SZ", $mypath)
EndIf
While 1
$file = FileOpen("log.txt", 9)
FileWrite($file, @YEAR & "." & @MON & "." & @MDAY & "--" & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF)
FileClose($file)
Sleep(5000)
WEnd
程序加启动项后,重启系统,发现FILEWRITE无法写入,这是为什么呢,只要在进程管理器里结束掉程序,再双击它,就可以正常了。就是加入启动项,启动的时候不行。 |