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


JAVASCRIPT TUTORIALS » MS JScript » File »

 

File.Copy()










Syntax








file.Copy(destination, overwrite)



The Copy() method is used to copy a file.

overwrite is a Boolean value indicating whether to overwrite an existing file of the same name.












<html>
    <BODY>
    <script language="JScript">
    <!--
    function copy()
    {
      var myObject, f;
      myObject = new ActiveXObject("Scripting.FileSystemObject");
      f = myObject.file.copy("c:\test.txt""c:\mytest.txt");
    -->
    </script>
    Copy test.txt to mytest.txt
    <form name="myForm">
    <INPUT type="Button" value="Copy File" onClick='copy()'>
    </form>
    </BODY>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» File