Powershell Shortcut mit Parametern
Hallo Community
Über einen Powershell Skript muss ich einen Shortcut erstellen. Die Exe Datei ruft hier noch eine Config Datei. Wenn ich das im Shell angeben ist das Ziel leer. Es scheint so, als ob die Parameter nicht erkannt werden.
Hier ein Auszug aus meinem Skript
Was ist im Shortcut.TargetPath falsch? Gibt es irgend einen Befehl für Shortcut "command line parameter"?
Im Voraus vielen Dank für Eure Hilfe
Über einen Powershell Skript muss ich einen Shortcut erstellen. Die Exe Datei ruft hier noch eine Config Datei. Wenn ich das im Shell angeben ist das Ziel leer. Es scheint so, als ob die Parameter nicht erkannt werden.
Hier ein Auszug aus meinem Skript
$DestinationFolder = "${env:ProgramFiles(x86)}\XMing\"
$ExeFile = "${env:ProgramFiles(x86)}\XMing\XLaunch.exe"
$Application = "argos-artemis.xlaunch"
$IconLocation = "$DestinationFolder\XLaunch.exe"
$IconIndex = "0"
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$LinkPath\$Link")
$Shortcut.IconLocation = "$IconLocation, $IconIndex"
**$Shortcut.TargetPath = "$ExeFile -run $DestinationFolder\$Application"**
$Shortcut.WorkingDirectory = "$DestinationFolder"
$Shortcut.Save()
Was ist im Shortcut.TargetPath falsch? Gibt es irgend einen Befehl für Shortcut "command line parameter"?
Im Voraus vielen Dank für Eure Hilfe
Please also mark the comments that contributed to the solution of the article
Content-Key: 881701733
Url: https://administrator.de/contentid/881701733
Printed on: April 20, 2024 at 02:04 o'clock
2 Comments
Latest comment