Jump to content

write computer name to a file


Recommended Posts

$fHandle = FileOpen("file.txt", 2)

FileWriteLine($fHandle, @ComputerName)

FileClose($fHandle)

FileOpen will create the file if it does not already exist. The '2' erases any previous contents of the file, and sets the pointer to the first character position in the file.

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

Thanks a bunch that saves me a ton of time

$fHandle = FileOpen("file.txt", 2)

FileWriteLine($fHandle, @ComputerName)

FileClose($fHandle)

FileOpen will create the file if it does not already exist.  The '2' erases any previous contents of the file, and sets the pointer to the first character position in the file.

<{POST_SNAPBACK}>

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...