How do I append DOS output to a file from an AutoIt script?
Posted on 2007-11-29
I've created an AutoIt script that gives me quick access to commonly used programs I use to perform routine maintenance on the computers at the office where I work.
One function I use is the NET TIME command so I can verify that the computer is set to receive the time from our server. I am trying to record the output of this command to a log file for future reference but my script is not logging it.
I have these variables initialized at the beginning of my script:
$file=$path & @ComputerName & ".txt"
And here is the code from the segment that runs the NET TIME command:
RunWait("net time >> " & $file)
FileOpen ($file, 1 )
FileWriteLine($file, _Now() & " - Ran NET TIME check" & @LF)
When I run the script, the DOS window flashes, but when I check the log all I see is the line saying it ran the NET TIME check.
How do I get the script to append the NET TIME output to the log file?