Is it possible to access local file via javascript?
<pre>

    if (window.ActiveXObject) {
        try {
            var fso = new ActiveXObject("Scripting.FileSystemObject"); 
            fso.CopyFile("C:\\Program Files\\GM4IE\\scripts\\source.txt","C:\\Program Files\\GM4IE\\scripts\\target.txt", 1);
            fso = null;
            }
            catch (e) {
            alert (e.message);
            }
    }

</pre>

<p>I am getting error : <b>
"Automation server can not create object"</b> on the line where I am creating ActiveXObject instance.<br>
I understand that it's considered very bad to access hard-drive data using javascript but I just need it.<br>
I am using <b>IE8 , Greasemonkey4IE </b> to run my javascript.</p>

<p>Thank you,<br>
Mohit<br><br></p>

<p><em><strong></em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>***</strong><br></p>

<pre>

    function WriteFile()
    {
       var fso  = new ActiveXObject("Scripting.FileSystemObject");
       fso.CopyFile("C:\\source.txt","C:\\target.txt", 1);
    }

</pre>

<p>I've put the above code inside a simple HTML page and it worked perfect.<br>
<a href="http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm" rel="nofollow">http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm</a><br>
You can find the similar code on above mentioned location.<br>
I modified it a bit, tough.<br>
But when I am trying to run it through <b>GreaseMonkey4IE</b> it simply spitting the same error I specified earlier.<br><br><br></p>

<hr>

<p>I did it guys, but thanks a lot for your quick and helpful replies.<br>
All I did is : <br>
    Go to Tools > Internet options > Security > Custom Level<br>
    Under the ActiveX controls and plug-ins, select Enable for Initializing and Script    ActiveX controls not marked as safe.<br></p>
