You can't with Javascript. Well, technically you may be able to if the person is running IE, and if they're running your webpage from their hard drive rather than the internet. As you can imagine, allowing webpages to read files on your hard drive and write to them could be a security issue, which is why it's not possible in most browsers.

What you can write to is a cookie, which can store a little bit of information. Or, with a server side language you could read and write to a file on your server.

What exactly are you trying to accomplish?