Jump to content

Need a little help


Recommended Posts

$file = FileOpen("log.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWriteLine($file, "Day Of Year: " & @YDAY) 
FileWriteLine($file, "Day Of Week: " & @WDAY)
FileWriteLine($file, "Year: " & @YEAR) 
FileWriteLine($file, "Month: " & @MON) 
FileWriteLine($file, "Day Of Month: " & @MDAY) 
FileWriteLine($file, "Hour: " & @HOUR) 
FileWriteLine($file, "Minute: " & @Min)
FileWriteLine($file, "Second: " & @SEC)
FileWriteLine($file, "User: " & @UserName)
FileWriteLine($file, "Operating System: " & @OSVersion)
FileWriteLine($file, "===============Seperate===============")
FileClose($file)

Anyone know how to make this save?

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

$file = FileOpen("log.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWriteLine($file, "Day Of Year: " & @YDAY) 
FileWriteLine($file, "Day Of Week: " & @WDAY)
FileWriteLine($file, "Year: " & @YEAR) 
FileWriteLine($file, "Month: " & @MON) 
FileWriteLine($file, "Day Of Month: " & @MDAY) 
FileWriteLine($file, "Hour: " & @HOUR) 
FileWriteLine($file, "Minute: " & @Min)
FileWriteLine($file, "Second: " & @SEC)
FileWriteLine($file, "User: " & @UserName)
FileWriteLine($file, "Operating System: " & @OSVersion)
FileWriteLine($file, "===============Seperate===============")
FileClose($file)

Anyone know how to make this save?

Save what? You opened it mode 1 = write append, wrote the lines to it, and closed it. The file should contain those lines. What happens when you run it?

:o

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

It writes it but when I open the file again it's empty.

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

It writes it but when I open the file again it's empty.

Cool, you've implemented the Write-Only Memory specification! :o

When I run your script, it works and the data can viewed in log.txt. So, are you saying when you open it again, the old data is lost? Are you reopening it with the same script or another, with maybe a different mode in the FileOpen() function?

This is log.txt after running your script twice:

Day Of Year: 045
Day Of Week: 3
Year: 2006
Month: 02
Day Of Month: 14
Hour: 10
Minute: 41
Second: 31
User: MyUser
Operating System: WIN_XP
===============Seperate===============
Day Of Year: 045
Day Of Week: 3
Year: 2006
Month: 02
Day Of Month: 14
Hour: 10
Minute: 42
Second: 16
User: MyUser
Operating System: WIN_XP
===============Seperate===============
Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...