AntiVirusGuy Posted May 18, 2005 Posted May 18, 2005 how do I wruite the computer name to a file something like @computername filewrite ("file.txt") do I need to creat the file first?
MSLx Fanboy Posted May 18, 2005 Posted May 18, 2005 $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())
AntiVirusGuy Posted May 19, 2005 Author Posted May 19, 2005 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}>
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now