I am writing a web page intended to list the subfolders included in a root folder. I do not want the full path name to show in the list, only the name of the folder itself. The references I have found tell me to use the ShortName property to achevie this, but in use, I get an error.
Here is the code I am using (path name replaced with **** for privacy)
[tt]
25 Dim FSobj, FldObj, FldCollObj
26 Set FSOBJ = Server.CreateObject("Scripting.FileSystemObject")
27 Set FldObj = FSObj.GetFolder("c:\**\**\**\**\picart")
28 Set FldCollObj = FldObj.SubFolders
29 For Each Item In FldCollObj
30 Response.write("<LI>" & Item.ShortName & "</LI>")
31 Next
[/tt]
This is the error that results:
[tt]
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
/picart/index.asp, line 30
[/tt]
If the same code is used without the ShortName property called on item, it works properly, but displays the entire path for each item.
How can I write only the folder name to the web page for each item?
Cheryl dc Kern
Here is the code I am using (path name replaced with **** for privacy)
[tt]
25 Dim FSobj, FldObj, FldCollObj
26 Set FSOBJ = Server.CreateObject("Scripting.FileSystemObject")
27 Set FldObj = FSObj.GetFolder("c:\**\**\**\**\picart")
28 Set FldCollObj = FldObj.SubFolders
29 For Each Item In FldCollObj
30 Response.write("<LI>" & Item.ShortName & "</LI>")
31 Next
[/tt]
This is the error that results:
[tt]
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
/picart/index.asp, line 30
[/tt]
If the same code is used without the ShortName property called on item, it works properly, but displays the entire path for each item.
How can I write only the folder name to the web page for each item?
Cheryl dc Kern