FileSystemObject.BuildPath() : FileSystemObject : MS JScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » MS JScript » FileSystemObject »

 

FileSystemObject.BuildPath()











Syntax








filesystemobject.BuildPath(path, name)




  1. path -- String representing existing path

  2. name -- Name being appended to existing path

The BuildPath() method is used to append a name to an existing path.

A separator is inserted between the existing path and the appended name if necessary.












<html>
    <body>
    <script language="JScript">
    <!--
    function GetNewPath(path)
    {
        var myObject, newpath;
        myObject = new ActiveXObject("Scripting.FileSystemObject");
        newpath = myObject.BuildPath(path, "/newstuff");
        alert("The result is: " + newpath);
    }
    -->
    </script>
    Append "/newstuff" to the existing path: "c:/tmp"
    <form name="myForm">
    <input type="Button" value="Build Path" onClick='GetNewPath("c:/tmp")'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» FileSystemObject