Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch for create a copy of the original file from a shortcut file.  (Read 6162 times)

0 Members and 1 Guest are viewing this topic.

Esgrimidor

    Topic Starter


    Hopeful

    Thanked: 1
    Batch for create a copy of the original file from a shortcut file.

    A Shortcut is a pointer to the original file.

    I would like a batch for select the shortcut file to transform in a copy of the original file.

    Best Regards
    No dejes que tu felicidad dependa de lo que no depende de tí.

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Batch for create a copy of the original file from a shortcut file.
    « Reply #1 on: May 01, 2011, 04:12:43 PM »
    Just curious as to why not use the full path with a regular copy or xcopy statement? Which shortcut would be dynamic in which you would want to use a shortcut with an unknown path, but a preset name?

    Esgrimidor

      Topic Starter


      Hopeful

      Thanked: 1
      Re: Batch for create a copy of the original file from a shortcut file.
      « Reply #2 on: May 01, 2011, 08:32:00 PM »
      What I am trying is :

      I have a shortcut file pointing to his original file.
      A Shortcut is a pointer to the original file.

      I would like to make a copy of the original file in the folder where the shorcut is, and then delete optionally the shortcut.

      Where can I find this script ?
      No dejes que tu felicidad dependa de lo que no depende de tí.

      DaveLembke



        Sage
      • Thanked: 662
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Batch for create a copy of the original file from a shortcut file.
      « Reply #3 on: May 01, 2011, 10:40:24 PM »
      Quote
      I have a shortcut file pointing to his original file

      If its not YOUR file then you are doing this over a network? With a shared path to HIS file which just happens to be a shortcut?

      Guessing this is a remote system on a network since if you just wanted to make an exact copy of a file you could do it through windows locally. Also guessing that this is not a one time copy since you could simply double-click on the shortcut to navigate to the file and get a copy that way if it was a 1 time copy.

      If you right-click your shortcut you can select properties, and then view the target path. Then select that target path and use that target path in a batch file such as

      xcopy shortcut_target_path\file_you_want.* c:\drop_file_here\*.* /s/d/y

      Replace shortcut_target_path with the target path that you got from your shortcut. If there are any spaces in the path you will need to bind it with " ". Also if you are using Windows Vista or 7, you will want to use robocopy instead of xcopy with different switches.

      Trying to push a shortcut.lnk into a batch is just going to be nothing but trouble. If you declare the unc path directly, you will be better off.  http://www.uwplatt.edu/oit/terms/uncpath.html

      If you run into a UNC path issue, you can always create a mapped drive to the folder location where that file resides such as X:    Then use xcopy x:\file_you_want.* c:\drop_file_here\*.* /s/d/y  or the robocopy equivilant if Vista or 7 at your end. And you have to bind the origin target path with " " if there are spaces.

      Esgrimidor

        Topic Starter


        Hopeful

        Thanked: 1
        Re: Batch for create a copy of the original file from a shortcut file.
        « Reply #4 on: May 02, 2011, 12:35:46 PM »
        It's done Dave. In autohotkey.
        I hope the next time will be more simple.
        Really I am afraid.

        Best Regards
        No dejes que tu felicidad dependa de lo que no depende de tí.