bills Posted June 10, 2007 Posted June 10, 2007 Im trying to at the end of my script open a textfile located on my desktop and write some info about what the script has done. I can open a new instance of notepad and get it to enter the info like this: Run("Notepad.exe") WinWaitActive("Untitled - Notepad") Send('Starttid: ' & $starttime & @CR & 'Antal gjorda länkbyten: ' & $Number & @CR & 'Sluttid: ' & _DateTimeFormat( _NowCalc(),0) & @CR & @CR) WinWaitNotActive("Untitled - Notepad") But i want it to open the file on my desktop instead and start writing at the bottom. The file is called "loggbok.txt" and is located at "C:\Documents and Settings\Bill\Desktop" Any ideas guys? //Bill
Valuater Posted June 10, 2007 Posted June 10, 2007 take a look at this_FileWriteLog Writes current date,time and the specified text to a log file. #include <File.au3>_FileWriteLog ( $sLogPath, $sLogMsg ) Parameters $sFilePath Path and filename of the file to be written to $sLogMsg Message to be written to the log file8)
bills Posted June 10, 2007 Author Posted June 10, 2007 The thing is that i dont want the date and time stamp in the beginning. Otherwise this would have been great!
Generator Posted June 10, 2007 Posted June 10, 2007 Here's an example, you get the idea. Global $FileName = @ScriptDir & "\data.dat" Global $i="Your text" FileClose(FileWrite(FileOpen($FileName,10),$i))
bills Posted June 10, 2007 Author Posted June 10, 2007 Here's an example, you get the idea. Global $FileName = @ScriptDir & "\data.dat" Global $i="Your text" FileClose(FileWrite(FileOpen($FileName,10),$i)) PERFECT! Thank you!
Helge Posted June 10, 2007 Posted June 10, 2007 (edited) Hei bills. Do you want to add text on a new line at the bottom of the file each time ? Why not just this : Global $FileName = @ScriptDir & "\data.dat" Global $i="Your text" FileWriteLine($FileName,$i) Edited June 10, 2007 by Helge
Valuater Posted June 11, 2007 Posted June 11, 2007 Hei bills. Do you want to add text on a new line at the bottom of the file each time ? Why not just this : Global $FileName = @ScriptDir & "\data.dat" Global $i="Your text" FileWriteLine($FileName,$i) I was thinking the same thing Helge 8)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now