Sign in to follow this  
Followers 0
AntiVirusGuy

write computer name to a file

3 posts in this topic

how do I wruite the computer name to a file something like @computername filewrite ("file.txt") do I need to creat the file first?

Share this post


Link to post
Share on other sites



$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())

Share this post


Link to post
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}>

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  
Followers 0