Sign in to follow this  
Followers 0
v1rtu0s1ty

saving text/string value to a file

2 posts in this topic

Hi everyone,

I need your help again. Can someone please share a code that will save the value of a variable to a text file. Also, the text file should be overwritten everytime it gets executed, and it should NOT grow.

$myvar = "This is a sample string"

save it to c:\temp\mytemp.txt

Thanks,

Neil

Share this post


Link to post
Share on other sites



Hi everyone,

I need your help again. Can someone please share a code that will save the value of a variable to a text file. Also, the text file should be overwritten everytime it gets executed, and it should NOT grow.

$myvar = "This is a sample string"

save it to c:\temp\mytemp.txt

Thanks,

Neil

<{POST_SNAPBACK}>

I got it guys :)

$file = FileOpen("C:\testautoit.txt", 2)

FileWriteLine($file, "this is a test");

FileClose($file)

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