Question:
Sorry if this has been asked before but I can’t find a relevant answer
I want to create a shortcut on a users desktop and fill in the Start In value on in.
I can create the Icon but how do I make powershell fill in the Start in value
1 2 3 4 5 6 7 |
$TargetFile = "C:\Program Files (x86)\Program" $ShortcutFile = "$env:Public\Desktop\Shorcut.lnk" $WScriptShell = New-Object -ComObject WScript.Shell $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile) $Shortcut.TargetPath = $TargetFile $Shortcut.Save() |
Answer:
You can fill in the “Start in” value by simply adding this line:
1 2 |
$Shortcut.WorkingDirectory = "Path" |