Mega Code Archive

 
Categories / JavaScript Tutorial / MS JScript
 

FileSystemObject BuildPath()

Syntax filesystemobject.BuildPath(path, name) path -- String representing existing path 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>