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

working with ,lnk files

$
0
0

I have the following code.

$linkpath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\_Department Applications"

$sh = New-Object -COM WScript.Shell

$targetPath = $sh.CreateShortcut('C:\ProgramData\Microsoft\Windows\Start Menu\Programs\_Department Applications\mta.lnk').TargetPath

$targetpath

When I run this $targetpath contains: "C:\Program Files\Internet Explorer\iexplore.exe"   but that is not all that is contained in the target path.  The full target path is "C:\Program Files\Internet Explorer\iexplore.exe" http://122.167.231.136:8080/workforce/Logon.do

How come my code only returns the first half of TargetPath?

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles