Editing shortcut (.lnk) properties with Powershell

Viewed 82264

I've found a nasty VBS way to do this, but I'm looking for a native PoSh procedure to edit the properties of a .LNK file. The goal is to reach out to remote machines, duplicate an existing shortcut with most of the correct properties, and edit a couple of them.

If it would just be easier to write a new shortcut file, that would work too.

4 Answers

A short addition to @JasonMArcher's answer..

To see available properties you can just run $shortcut after $shortcut = $shell.CreateShortcut($destination) in a PS. This will print all properties and their current values.

I don't think there's a native way.

There is this DOS util: Shortcut.exe.

You still need to copy the util to the remote system, then possibly call it using WMI to make the changes you're looking for.

I'm thinking the easier way will be to overwrite and/or create a new file.

Do you have access to these systems via a remote share?

Related