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


JAVASCRIPT TUTORIALS » MS JScript » FileSystemObject »

 

FileSystemObject.GetFileName()










Syntax








filesystemobject.GetFileName(filename)



The GetFileName() method gets a specified filename.

This method takes filename as its only parameter.












<html>
    <body>
    <script language="JScript">
    <!--
    function getname()
    {
        var myObject, name;
        myObject = new ActiveXObject("Scripting.FileSystemObject");
        name = myObject.GetFileName("c:\test.txt");
        alert("The file name is:" + name);
    }
    -->
    </script>
    Get the name value for the file "test.txt"
    <form name="myForm">
    <input type="Button" value="Get File Name" onClick='getname()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» FileSystemObject