Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

getting shortcut target path

$
0
0

$sh=New-Object-COMWScript.Shell
$targetPath=$sh.CreateShortcut('C:\Users\Public\Desktop\Web Mail.lnk').TargetPath
$targetPath

That code almost works.   It does get part of the target but not all of it.  This Web Mail.lnk has this for the target path:  "C:\Program Files\Internet Explorer\iexplore.exe" http://mail.acme.org

How come PowerShell only gets c:\program files\Internet Explorer\iexplore.exe?  how do I get all of the path?  

Thank you.  


Viewing all articles
Browse latest Browse all 6937

Trending Articles