To find a file's folder, use the ParentFolder() method of the File object. Here is a piece of script that will print a file's folder:

 

<SCRIPT LANGUAGE="JavaScript">
<!--
  myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
  file = myActiveXObject.GetFile("f:\\yehuda\test.txt");
  alert(file.ParentFolder());
// -->
</SCRIPT>

 

Send mail to santhosh_emids@yahoo.com with questions or comments about this web site.
Last modified: November 16, 2000