File.Delete() : File : MS JScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » MS JScript » File »

 

File.Delete()







The Delete() method is used to delete a specified file.












<html>
    <body>
    <script language="JScript">
    <!--
    function remove()
    {
        var myObject;
        myObject = new ActiveXObject("Scripting.FileSystemObject");
        var f = myObject.GetFile("c:\test.txt");
        f.Delete();
    }
    //-->
    </script>
    Delete file "mytest.txt".
    <form name="myForm">
    <input type="Button" vvalue="Delete File" onClick='remove()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» File