<html>
<body>
<script language="JScript">
<!--
function get()
{
var myObject, f;
myObject = new ActiveXObject("Scripting.FileSystemObject");
f = myObject.GetFile("c:\\yourfolder\\myTest.txt");
alert("The name of the parent folder is: " + f.ParentFolder.Path);
}
//-->
</script>
Click to get the name of the parent folder
<form name="myForm">
<input type="Button" value="Get Parent Folder" onClick='get()'>
</form>
</body>
</html>
|