Jump to content

Recommended Posts

Posted

I need to be able to find all target path locations for applications in a specific folder.

 

For example - we have a specific folder for the start menu and we want to be able to run a command that lists all target paths for each application in the folder so we can see where they point to etc.

 

Is this possible? My Powershell Knowledge is very basic 😂

 

Thanks!

Posted

I tweaked a function found via google, seems to work from my testing - might be worth you trying?:

 

function Get-StartMenuShortcuts($RootFolder){
   $Shortcuts = Get-ChildItem -Recurse $RootFolder -Include *.lnk
   $Shell = New-Object -ComObject WScript.Shell
   foreach ($Shortcut in $Shortcuts){
       $Properties = @{
       ShortcutName = $Shortcut.Name;
       ShortcutFull = $Shortcut.FullName;
       ShortcutPath = $shortcut.DirectoryName
       Target = $Shell.CreateShortcut($Shortcut).targetpath
       }
       New-Object PSObject -Property $Properties
   }
}
$Output = Get-StartMenuShortcuts -RootFolder "Enter the path to root folder containing shortcuts here"
$Output | select ShortcutName,Target

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...