Page 1 of 1

extract parts of file attributes: URL

Posted: Sun Dec 13, 2015 6:22 pm
by Thade
Don't know how to explain in English ... I try:

If you create a link to a website in Windows Explorer the link is not actually stored in the File itself - whatever you write or change there, the original link stays intact, because its inside the fileattributes
In this case: URL and LinkTarget
You can change this in Settings (rightclick on the Filename, etc....)

How can this be done with PB?
In other words. The File System shown in Windows Explorer includes lots of informations: Name, Address, Birthday, Location, URL, Street, and hundreds of other info ...
For an automated Link-Collection it would be great if I could get and set some of them (especially URL) with a short PB snippet.
Any idea how?

Re: extract parts of file attributes: URL

Posted: Sun Dec 13, 2015 8:23 pm
by infratec
Hi,

simply open the file with ReadFile()
read in line by line and search for example for URL=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.purebasic.fr/english
IDList=
http://www.fmtz.com/formats/url-file-format/article

for binary link files:
http://download.microsoft.com/download/ ... INK%5D.pdf

Bernd

Re: extract parts of file attributes: URL

Posted: Sun Dec 13, 2015 9:55 pm
by Thade
Well, I was that far ...
Even got the same links searching google ...

[EDIT]
Deleted the first answer ... was based on changing the content with a hexeditor and saving it back ... in this case it is irrelevant what is inside the file ... the url still is the old one.

Yes - you are right. Thanks for the help. :)
When I read the file and use it as base for any link - replace the link and save it with another-name.url it works ... is not the way I wanted it ... but still it is a first option to get further with my program.

I thought for a function like GetFileData( .... ) but instead for the date it peeks for the URL inside the 4096 Bytes that are on the HD ;)