Jump to content

Recommended Posts

Posted (edited)

Hi.

I'm trying to create a little script that pulls a couple of itmes form a pc registry and then writes a few lines to a text file.

I want all the pc's to append to a single text file. It seems that the mode "1" for FileOpen does not work as it never appends to the existing txt file.

#include <File.au3>
If Not _FileCreate("\\server\share\AdobeInfo.txt") Then
EndIf

$file = FileOpen("\\server\share\AdobeInfo.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWriteLine($file, "Computer Name: " & $pcname & @CRLF)
FileWriteLine($file, "Adobe Acrobat Version: " & $version & @CRLF)
FileWriteLine($file, "Serial Number: " & $var & $var4 & @CRLF)
FileWriteLine($file, "Install Date: " & $var2 & $var5 & @CRLF)
FileWriteLine($file, @CRLF)

FileClose($file)

NEVERMIND!!!!! I figured it out. I had to remove the filecreate function. it seems it was recreating the file every time. My BAD!!!

Edited by TheBG

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
  • Recently Browsing   0 members

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