jetmanus
jetmanus

Reputation: 93

Create a Powershell shortcut with start in path

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

$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()

Upvotes: 8

Views: 11654

Answers (1)

TNF
TNF

Reputation: 71

You can fill in the "Start in" value by simply adding this line:

$Shortcut.WorkingDirectory = "Path"

Upvotes: 7

Related Questions