Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Delphi
  4. html path in .lnk file

html path in .lnk file

Scheduled Pinned Locked Moved Delphi
questionhtmlhelp
23 Posts 5 Posters 97 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S smags13

    well, .lnk is used to point to an object inside Shell namespace. I suppose you meant .url file. .url file is actually an INI file, so you can try to use TIniFile class to parse your file, regardless of the extension it suggests.

    L Offline
    L Offline
    limelect
    wrote on last edited by
    #3

    Unfortunately i can not post a file here but goto my discussion here http://forums.about.com/n/pfx/forum.aspx?msg=19194.8&nav=messages&webtag=ab-delphi Download project zip and inside you will find the .lnk file i have problems with If you can help it will be great. PlZ also see all communication on this forum as i explain now 100 time it is not a text (url) file but a .lnk file!!! see also http://www.codeproject.com/Messages/3904379/Re-html-string-in-lnk-file.aspx

    modified on Thursday, May 26, 2011 1:42 AM

    L 1 Reply Last reply
    0
    • L limelect

      Unfortunately i can not post a file here but goto my discussion here http://forums.about.com/n/pfx/forum.aspx?msg=19194.8&nav=messages&webtag=ab-delphi Download project zip and inside you will find the .lnk file i have problems with If you can help it will be great. PlZ also see all communication on this forum as i explain now 100 time it is not a text (url) file but a .lnk file!!! see also http://www.codeproject.com/Messages/3904379/Re-html-string-in-lnk-file.aspx

      modified on Thursday, May 26, 2011 1:42 AM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #4

      limelect wrote:

      as i explain now 100 time it is not a text (url) file but a .lnk file!!!

      You have not explained this 100 times. And despite repeated requests you still have not clarified what the content of the file looks like. The extension of the file (.lnk or .url) is irrelevant, it is the content that we have asked you to look at.

      The best things in life are not things.

      L S 2 Replies Last reply
      0
      • L Lost User

        limelect wrote:

        as i explain now 100 time it is not a text (url) file but a .lnk file!!!

        You have not explained this 100 times. And despite repeated requests you still have not clarified what the content of the file looks like. The extension of the file (.lnk or .url) is irrelevant, it is the content that we have asked you to look at.

        The best things in life are not things.

        S Offline
        S Offline
        ShilpiP
        wrote on last edited by
        #5

        Hi Richard, I view his file and it is not giving me any option of "Open with" as a normal shortcut files did. If i drag and drop that file in notepad than it give only garbage character not like you mentioned in your answer. The problem is that 1) if problematically we create a shortcut using IShellLink and set the target name a URL than a shortcut of URL is created. Manually I don't think it is possible. But it is not correct shortcut. I did it by mistake in one of my project so I know this issue. This guy also create the link with installer and that's why he face this issue. 2) I will give him a suggestion that try to create a shortcut of URL using IUniformResourceLocator. If he create a proper shortcut than only he will get the proper name of URL using GetURL. :)

        "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

        L L 2 Replies Last reply
        0
        • L Lost User

          limelect wrote:

          as i explain now 100 time it is not a text (url) file but a .lnk file!!!

          You have not explained this 100 times. And despite repeated requests you still have not clarified what the content of the file looks like. The extension of the file (.lnk or .url) is irrelevant, it is the content that we have asked you to look at.

          The best things in life are not things.

          L Offline
          L Offline
          limelect
          wrote on last edited by
          #6

          Sorry content of the file looks like. Just see my last reply before that one there is a link to zip file where the .lnk is Further more see this communication http://www.codeproject.com/Messages/3905115/Re-html-string-in-lnk-file.aspx[^]

          S 1 Reply Last reply
          0
          • S ShilpiP

            Hi Richard, I view his file and it is not giving me any option of "Open with" as a normal shortcut files did. If i drag and drop that file in notepad than it give only garbage character not like you mentioned in your answer. The problem is that 1) if problematically we create a shortcut using IShellLink and set the target name a URL than a shortcut of URL is created. Manually I don't think it is possible. But it is not correct shortcut. I did it by mistake in one of my project so I know this issue. This guy also create the link with installer and that's why he face this issue. 2) I will give him a suggestion that try to create a shortcut of URL using IUniformResourceLocator. If he create a proper shortcut than only he will get the proper name of URL using GetURL. :)

            "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #7

            That seems like the right way to go.

            The best things in life are not things.

            S 2 Replies Last reply
            0
            • L Lost User

              That seems like the right way to go.

              The best things in life are not things.

              S Offline
              S Offline
              ShilpiP
              wrote on last edited by
              #8

              :)

              "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

              1 Reply Last reply
              0
              • L limelect

                Sorry content of the file looks like. Just see my last reply before that one there is a link to zip file where the .lnk is Further more see this communication http://www.codeproject.com/Messages/3905115/Re-html-string-in-lnk-file.aspx[^]

                S Offline
                S Offline
                smags13
                wrote on last edited by
                #9

                Yeah, I see what you mean. I've tried using IUniformResourceLocator and IPropertyStorage, following the guide from MSDN on both Vista and XP (Internet Shortcut[^]), but none of them returns a bit. (Note they categorize this page as Legacy Shell Features, don't know if they've removed it or not) The alternative way I could think of is to open this file through a hidden web browser control and then read the URL from it.

                L 1 Reply Last reply
                0
                • S smags13

                  Yeah, I see what you mean. I've tried using IUniformResourceLocator and IPropertyStorage, following the guide from MSDN on both Vista and XP (Internet Shortcut[^]), but none of them returns a bit. (Note they categorize this page as Legacy Shell Features, don't know if they've removed it or not) The alternative way I could think of is to open this file through a hidden web browser control and then read the URL from it.

                  L Offline
                  L Offline
                  limelect
                  wrote on last edited by
                  #10

                  Obviously this is not the way to go. because right mouse click on the file bring the properties. In the properties one sees the STRING http://.... So if Microsoft dose it we programmers can do it to BUT HOW that is the BIG BIG qeuestion. I have put this problem on 4 forumes Delphi and c++ no one gave me an answer Some went to URL file but the problem is the .lnk file. And it is a .lnk file. Well to sum it up good luck in the search for an answer.

                  L S 2 Replies Last reply
                  0
                  • S ShilpiP

                    Hi Richard, I view his file and it is not giving me any option of "Open with" as a normal shortcut files did. If i drag and drop that file in notepad than it give only garbage character not like you mentioned in your answer. The problem is that 1) if problematically we create a shortcut using IShellLink and set the target name a URL than a shortcut of URL is created. Manually I don't think it is possible. But it is not correct shortcut. I did it by mistake in one of my project so I know this issue. This guy also create the link with installer and that's why he face this issue. 2) I will give him a suggestion that try to create a shortcut of URL using IUniformResourceLocator. If he create a proper shortcut than only he will get the proper name of URL using GetURL. :)

                    "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

                    L Offline
                    L Offline
                    limelect
                    wrote on last edited by
                    #11

                    That is NOT the way to go. I want to read the file NOT MAKE IT. Since if i get this problematic .lnk file And Microsoft (trough the properties) can read it as a link file so i can as a programmer But how?

                    S 1 Reply Last reply
                    0
                    • L limelect

                      That is NOT the way to go. I want to read the file NOT MAKE IT. Since if i get this problematic .lnk file And Microsoft (trough the properties) can read it as a link file so i can as a programmer But how?

                      S Offline
                      S Offline
                      ShilpiP
                      wrote on last edited by
                      #12
                      1. Check what is the problem in installer to create the shortcut, there might be a solution to this problem... Which installer you are using ?? 2) Worst case scenario is read the .lnk file as a text file and parse the http: string.

                      "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

                      L 1 Reply Last reply
                      0
                      • L limelect

                        Obviously this is not the way to go. because right mouse click on the file bring the properties. In the properties one sees the STRING http://.... So if Microsoft dose it we programmers can do it to BUT HOW that is the BIG BIG qeuestion. I have put this problem on 4 forumes Delphi and c++ no one gave me an answer Some went to URL file but the problem is the .lnk file. And it is a .lnk file. Well to sum it up good luck in the search for an answer.

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #13

                        Did you try asking Microsoft? I downloaded your .lnk file and had a look at it via Properties. I noticed that although it displayed the URL text, it was not possible to edit it in any way, which suggests that even Microsoft did not accept it as a valid link. I guess there is some undocumented feature that allows access to it, possibly by having the details of the file structure.

                        The best things in life are not things.

                        L S 3 Replies Last reply
                        0
                        • S ShilpiP
                          1. Check what is the problem in installer to create the shortcut, there might be a solution to this problem... Which installer you are using ?? 2) Worst case scenario is read the .lnk file as a text file and parse the http: string.

                          "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

                          L Offline
                          L Offline
                          limelect
                          wrote on last edited by
                          #14

                          I took the link and read it trough hex editor It is the same format as a "regular" lnk sending you the link as text files

                          1 Reply Last reply
                          0
                          • L Lost User

                            Did you try asking Microsoft? I downloaded your .lnk file and had a look at it via Properties. I noticed that although it displayed the URL text, it was not possible to edit it in any way, which suggests that even Microsoft did not accept it as a valid link. I guess there is some undocumented feature that allows access to it, possibly by having the details of the file structure.

                            The best things in life are not things.

                            L Offline
                            L Offline
                            limelect
                            wrote on last edited by
                            #15

                            P.S read the link into hex Editor and a "regular" link and you will see the format is same

                            modified on Friday, May 27, 2011 2:12 PM

                            1 Reply Last reply
                            0
                            • L Lost User

                              Did you try asking Microsoft? I downloaded your .lnk file and had a look at it via Properties. I noticed that although it displayed the URL text, it was not possible to edit it in any way, which suggests that even Microsoft did not accept it as a valid link. I guess there is some undocumented feature that allows access to it, possibly by having the details of the file structure.

                              The best things in life are not things.

                              L Offline
                              L Offline
                              limelect
                              wrote on last edited by
                              #16

                              see http://www.codeproject.com/Messages/3906931/TO-EVRY-BODY-html-path-in-lnk-file.aspx[^] download link explanation pdf

                              1 Reply Last reply
                              0
                              • L limelect

                                Obviously this is not the way to go. because right mouse click on the file bring the properties. In the properties one sees the STRING http://.... So if Microsoft dose it we programmers can do it to BUT HOW that is the BIG BIG qeuestion. I have put this problem on 4 forumes Delphi and c++ no one gave me an answer Some went to URL file but the problem is the .lnk file. And it is a .lnk file. Well to sum it up good luck in the search for an answer.

                                S Offline
                                S Offline
                                smags13
                                wrote on last edited by
                                #17

                                I agree with you. If they can, we can, as long as both of us are using the documented methods. :) If the URL data is stored in Property Set of the internet shortcut file, File System will not keep this part of data when the file is moved by default. Have you tried to parse the file using the original path where the link file was generated? If you can access the original shortcut file, can you check if the URL text in Properties is editable or not?

                                1 Reply Last reply
                                0
                                • L Lost User

                                  Did you try asking Microsoft? I downloaded your .lnk file and had a look at it via Properties. I noticed that although it displayed the URL text, it was not possible to edit it in any way, which suggests that even Microsoft did not accept it as a valid link. I guess there is some undocumented feature that allows access to it, possibly by having the details of the file structure.

                                  The best things in life are not things.

                                  S Offline
                                  S Offline
                                  smags13
                                  wrote on last edited by
                                  #18

                                  I tried to parse the file using IPropertyStorage with FMTID_Intshcut and FMTID_InternetSite, it turns out both of the property set is empty even though they can be opened successfully. Nevertheless, I can see the URL string from binary viewer. I think they store data into both shortcut file and its property set. In stead of using documented methods to read data out using IPropertyStorage from property set, they might use some undocumented methods to read data directly from the file, as you said.

                                  1 Reply Last reply
                                  0
                                  • L limelect

                                    If i have a .lnk file that point to a link of http://.... type HOW do i get the string http://..... using IShellLink GetPath or GetDescription or any thing else do not give me a solution. the GetWorkingDirectory give me system32 as path but i want the string http://..... any help???

                                    R Offline
                                    R Offline
                                    Rhaddamant
                                    wrote on last edited by
                                    #19

                                    answering your ask everyone interested please check the following discussion: http://forums.about.com/n/pfx/forum.aspx?tsn=11&nav=messages&webtag=ab-delphi&tid=19194[^]

                                    L 1 Reply Last reply
                                    0
                                    • L Lost User

                                      That seems like the right way to go.

                                      The best things in life are not things.

                                      S Offline
                                      S Offline
                                      ShilpiP
                                      wrote on last edited by
                                      #20

                                      :confused: Why down-vote and why today?? If my statement is wrong than mention it please.

                                      "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

                                      L 1 Reply Last reply
                                      0
                                      • R Rhaddamant

                                        answering your ask everyone interested please check the following discussion: http://forums.about.com/n/pfx/forum.aspx?tsn=11&nav=messages&webtag=ab-delphi&tid=19194[^]

                                        L Offline
                                        L Offline
                                        limelect
                                        wrote on last edited by
                                        #21

                                        Thank you every body finally an answer that works http://forums.about.com/n/pfx/forum.aspx?msg=19194.13&nav=messages&webtag=ab-delphi[^]

                                        1 Reply Last reply
                                        0
                                        • S ShilpiP

                                          :confused: Why down-vote and why today?? If my statement is wrong than mention it please.

                                          "Every Little Smile can touch Somebody's Heart... May we find Hundreds of Reasons to Smile Everyday... and May WE be the Reason for someone else to smile always!" (ICAN) "Your thoughts are the architects of your destiny."

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #22

                                          :confused: I did not down vote your comments.

                                          The best things in life are not things.

                                          S 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups