Jump to content
Sign in to follow this  

fileRead for a "$var"

Recommended Posts


just looking for some tips on the best way to do this

i want to write information to at .txt, i use @ComputerName to separate all of my entries

is there a way to do a file read for the @ComputerName as a variable and say if it exists in the .txt then , msgbox an error?

Share this post

Link to post
Share on other sites

This possibly the answer to the first part of your question:


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

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

FileWriteLine($file, @ComputerName & @crlf)
FileWriteLine($file, _NowDate())

Not sure what you mean about the other, but it sounds like "IsKeyword" might do the trick

Good Luck!

Share this post

Link to post
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
Sign in to follow this