November 06, 2000 - Finding a File's Type
November 06, 2000 Finding a File's Type Tips: November 2000
Yehuda Shiran, Ph.D.
|
Type
property. Here is a script that prints the file type:
<SCRIPT LANGUAGE="JavaScript">
<!--
myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
file = myActiveXObject.GetFile("f:\\yehuda\test.txt");
alert(file.Type);
// -->
</SCRIPT>
Here is the popout windows that you'll get for three different types of files:
Notice that the file type is identical to what is shown by the Properties tab when you right click the file icon.