Windows 10: Target for a folder full of links will be moved


  1. Posts : 5,007
    Windows 10 Pro X64 15063.138
       04 Jun 2016 #1

    Target for a folder full of links will be moved


    I have a folder that contains links to programs that reside in various other folders, called SysTools. I like to have the links for tools I use for various things in one place.

    I'm copying the SysTools folder to my Laptop and need to change all the Target drives from D:\..... to C:\.....
    Anyone know of a program that can do this in bulk or the Powershell command that could do this?

    If there were only a few I'd do it manually but there are over 70 so some automation would be nice.
      My ComputersSystem Spec


  2. Posts : 5,007
    Windows 10 Pro X64 15063.138
    Thread Starter
       04 Jun 2016 #2

    I found some of what I need.

    Code:
    $shell = New-Object -COM WScript.Shell
    $targetPath = $shell.CreateShortcut($FullLinkPath).TargetPath
    This gets me the existing Target path when I give it the fully qualified path to the link.

    I think this will replace D:\ with C:\

    Code:
    $newtargetpath = "$targetpath" -replace 'D:\' C:\'
    Now how do I update the Target path in the original link?

    Would something like

    Code:
    $shell.TargetPath = $newtargetpath
    do the trick?
      My ComputersSystem Spec


 

Related Threads
Hello, I recently upgraded to Windows 10, Put OS onto SSD along with a few other essentials and have a second hard drive for storage. The shared Pictures, Videos, Documents (etc) folders were all by default on my relatively small SSD. Figured...
When I create a shortcut to file in Program Files, the target path for that shortcut will be to Program Files (x86), even though the start in path will be correct. Furthermore, even though the target path is incorrect and no icon is displayed for...
Was fixed
I have previously read on windows10update that Microsoft was planning to move IE to the accessories folder, and remove its shortcuts on the taskbar and start menu. I thought this would only happen in a future build... But it's already the case...
Source See also: Windows 10 release date rumors challenge traditional development schedule
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 19:09.
Find Us