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.
the .lnk files are standard windows link files. you can manipulate with Powershell indirectly through the vbscripting objects:
links in documents/emails that are html style links have to be modified by tools that work in that document's application.
There is this too:
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!
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.
Dan WilliamsSolution ConsultantBentley Systems, IncorporatedPortland, OR, USA (Pacific Time UTC-08:00)
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")
Could probably write a powershell to modify the binary and write it back out.