Jump to content

Output lnk targets from folder of shortcuts ?


Recommended Posts

Posted

You can do it with a little bit of Powershell. Just change the paths below for where your shortcuts are (line 2) and where you want to save your CSV (last line):

 

$shell = New-Object -ComObject WScript.Shell
Get-ChildItem -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\*.lnk" | ForEach-Object {
   $shortcutData = [PSCustomObject]@{
       shortcut = $_.FullName
       target = $shell.CreateShortcut($_.FullName).TargetPath
       args = $shell.CreateShortcut($_.FullName).Arguments
   }
   $shortcutData
} | Export-CSV -Path "C:\Users\username\Desktop\Shortcuts.csv" -NoTypeInformation

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...