Announcement

Collapse
No announcement yet.

Get the network link of a file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get the network link of a file

    Hi everyone. may i ask for a help.. i really can figure out how to convert this image link of my pc into a network link so that other pc can get it directly..

    example
    in my pc1 i have this image file save:

    filePath = "C:\Users\%username%\Desktop\SharedFolder\test .pmg "

    i want to save that path into a text file so that pc2 in the network once it load the txt file it will load to the Image object.

    ex: "local networkLink = "file:///" .. filePath:gsub("\", "/")​

    TextFile.WriteFromString("C:\\Users\\Admin\Desktop \\SharedFolder\", networkLink, false);




    PC2
    User load the txt file in AMS


    Example: Image.Load("Image1", //%username%/SharedFoldertest.png)



    Can you help me with this? thank you

  • #2
    Example: Image.Load("Image1", //%username%/SharedFolder/test.png)

    Comment


    • #3
      Hey Man that is rather vague, I think we have been here before

      Your Network share must include PC Name
      Have a quick look at this
      https://pureinfotech.com/find-computers-network-windows-11/
      to make sure the network is setup correctly​

      Comment


      • #4
        Yes computer have setup correctly.. and the shared folder is accesable from each computer.. i just want to convert the local path into network path.

        so im having issue now how to convert the path

        Comment


        • #5
          OK I think your back slashes are wrong way round

          Code:
          --Find files on Network Drive for PSRB Committee
          files = File.Find("\\\\usldcvs1fsh02\\lnlccf20$\\SAFETY\\Safety Committees\\Minutes of All Safety Committees\\PSRB", "*.*", false, false, nil);​

          Comment


          • #6
            Local Path:
            C:\Users\Admin\Documents\TEST FOLDER\FILES\test.txt


            Network Path:
            \\LAPTOP-JKLS\TEST FOLDER\FILES\text.txt


            Hi here is what i want to achieve, as you can see that local path is already a shared folder from PC1, now when i browse that folder in PC2 the path change as it in Network Path.

            Now, how can i change or convert that Local path into a network path so that i can save it as a string or into a text file?


            Thanks

            Comment


            • #7
              Try the following example that utilizes MemoryEx and netapi. Beware that this example returns all possible share paths for a local path and allows you to filter out hidden shares, but there is not a guaranteed share path to a local path. There can be 0 to N options.
              Attached Files
              Bas Groothedde
              Imagine Programming :: Blog

              AMS8 Plugins
              IMXLH Compiler

              Comment


              • #8
                HI Imagine Programming i tried but give negative result

                Possible network paths for 'C:\Users\Admin\Desktop\network path':
                1 = \\LAPTOP-Proi9\C$\Users\Admin\Desktop\network path
                2 = \\LAPTOP-Proi9\Users\\Admin\Desktop\network path​


                the network should return like this

                \\LAPTOP-Proi9\network path​

                and PS the user browse Files not Folder.
                so if the file Path is this:

                "C:\Users\Admin\Desktop\network path\sample.txt

                the result network path should this:

                \\LAPTOP-Proi9\network path​\sample.txt

                Comment


                • #9
                  Originally posted by telco View Post
                  HI Imagine Programming i tried but give negative result

                  Possible network paths for 'C:\Users\Admin\Desktop\network path':
                  1 = \\LAPTOP-Proi9\C$\Users\Admin\Desktop\network path
                  2 = \\LAPTOP-Proi9\Users\\Admin\Desktop\network path​


                  the network should return like this

                  \\LAPTOP-Proi9\network path​

                  and PS the user browse Files not Folder.
                  so if the file Path is this:

                  "C:\Users\Admin\Desktop\network path\sample.txt

                  the result network path should this:

                  \\LAPTOP-Proi9\network path​\sample.txt
                  Is this copied from the example application? Can you make a screenshot of it? I see a double slash between Users and Admin in the second entry, which is weird, as it could mean a segment is not appended.

                  EDIT Please send me the full output in the result
                  Bas Groothedde
                  Imagine Programming :: Blog

                  AMS8 Plugins
                  IMXLH Compiler

                  Comment


                  • #10
                    Originally posted by telco View Post
                    HI Imagine Programming
                    and PS the user browse Files not Folder.
                    I'm not making your project for you, the apz is an example, it works with file paths too. But you need to help me out here, by sending me the output.

                    Bas Groothedde
                    Imagine Programming :: Blog

                    AMS8 Plugins
                    IMXLH Compiler

                    Comment

                    Working...
                    X
                    😀
                    🥰
                    🤢
                    😎
                    😡
                    👍
                    👎