Solved [VB script] Get The File Name Of A URL ?

September 15, 2014 at 08:04:13
Specs: Windows XP
e.g. URL = ""

How can i get the text "file.txt" only?



See More: [VB script] Get The File Name Of A URL ?

Report •

September 15, 2014 at 10:41:08
✔ Best Answer
Well, there's always Scripting.FileSystemObject's GetFileName, but that only returns everything after the final '/' or '\'.

If you're expecting it to be a real file, you could always ask the server in question. Follow the example and comments here:, but use HEAD instead of GET. HEAD says you only want the metadata, and not the actual file. Since you're not actually downloading the data, you can drop the ADODB.Stream object from the example.

How To Ask Questions The Smart Way

message edited by Razor2.3

Report •
Related Solutions

Ask Question