Jump to content
Sign in to follow this  
v1rtu0s1ty

saving text/string value to a file

Recommended Posts

v1rtu0s1ty

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
v1rtu0s1ty

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.