Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum How to update projectwise shortcuts to point to new datasource ?
    • Sign In

    • State Suggested Answer
    • Replies 7 replies
    • Answers 2 answers
    • Subscribers 67 subscribers
    • Views 1150 views
    • Users 0 members are here
    • ProjectWise
    • ProjectWise PowerShell Modules

    How to update projectwise shortcuts to point to new datasource ?

    Mario Molotkov
    Offline Mario Molotkov over 2 years ago

    We recently upgraded from projectwise v8i to the latest version, and in the process moved all our folder structure to a new datasource. Many of our users had shortcuts pointing to some files in the old setup, is there a powershell script or some other way to allows those shortcuts to point to the new Datasource. The paths are all the same except for the datasource name.

    Thanks,

    • Sign in to reply
    • Cancel
    Parents
    • Kevin van Haaren
      0 Offline Kevin van Haaren Wed, Oct 14 2020 5:52 PM

      the .lnk files are standard windows link files. you can manipulate with Powershell indirectly through the vbscripting objects:

      https://geeklifenow.com/2019-04-06-PS_ChangeShortcutTarget/

      links in documents/emails that are html style links have to be modified by tools that work in that document's application.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Wed, Oct 14 2020 5:53 PM in reply to Kevin van Haaren

      There is this too:

      https://devblogs.microsoft.com/scripting/how-can-i-change-the-target-of-a-desktop-shortcut/

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Kevin van Haaren
      0 Offline Kevin van Haaren Wed, Oct 14 2020 5:53 PM in reply to Kevin van Haaren

      There is this too:

      https://devblogs.microsoft.com/scripting/how-can-i-change-the-target-of-a-desktop-shortcut/

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    • Mario Molotkov
      0 Offline Mario Molotkov Thu, Oct 15 2020 10:11 AM in reply to Kevin van Haaren

      Hi,

      I tried that before posting here. They don't seem to be regular windows lnk files,  in the screenshot below the target path attribute is where the target would usually be indicated. While here it is empty, and nowhere to see the target!

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Dan Williams
      0 Offline Dan Williams Thu, Oct 15 2020 1:13 PM in reply to Mario Molotkov

      I'm no expert on Windows .lnk files, but if you look at the tag "Shortcut" on the properties dialog for various .lnk files on your desktop, you will see variations in the values for "Target type:", "Target location:", etc.  For ProjectWise .lnk files, at least "on my box" (Windows 10 Enterprise Edition, 64bit, ProjectWise Explorer v10.00.03.280), I see this:

      But for a .lnk file that is for a text file, I see this:

      FWIW, I suspect that any editing of these .lnk files needs to understand these variations. I was able to edit a ProjectWise .lnk file with a binary editor and I just changed the target document's name, which had the same datasource, folder path and name length (so I didn't change any other byes), and the edited .lnk file did take me to the document I specified.

      I'm sure that the .lnk files can be edited with the "right" tools, but I can't offer anything specific.  The article that Kevin Van Haaren pointed to might be worth investigating (I didn't try it) as it deals with "target address for a .url/.lnk".  You might have to dive into Microsoft's Windows API documentation to find the details of .lnk files in order to come up with your own tool or keep searching for an existing tool that can account for the differences in "Target type", "Target location", and "Target", and perhaps other properties as well.

      Alternatively, perhaps it is time to consider using the "Custom Folders" feature in ProjectWise Explorer, or (better?) perhaps the "Work Basket" custom tool included with MostOfDavesTools found here:  https://communities.bentley.com/search?q=mostofdavestools&group=400 

      You can take a look at the existing documentation for MostOfDavesTools here: https://communities.bentley.com/products/projectwise/content_management/m/mediagallery/274629 

      FWIW, the Work Basket tool saves its data in an XML file located in the OS user's ./Appdata/Local/Temp directory, which if you are careful, you can edit with a text editor if you ever have this particular problem again.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, Oct 15 2020 3:46 PM in reply to Dan Williams

      I messed around with both powershell and a 3rd party command line tool for modifying .lnk files and both had the results Mario had where the Target doesn't resolve. Apparently there is some new shortcut type that Windows/PW Explorer creates that it won't work with. I tried both tools on a .lnk created by Windows Explorer and it worked fine.

      I started to mess around with the binary and had to give up when some other issues took precedent. I was able to read in the binary content with powershell by doing:

      $bytes = [System.IO.File]::ReadAllBytes("c:\users\kvanhaaren\desktop\CADDLib.lnk")
      [System.Text.Encoding]::ASCII.Getstring($bytes)

      Could probably write a powershell to modify the binary and write it back out.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies