mgeeky-Penetration-Testing-.../red-teaming/Create-Lnk.ps1
2020-08-04 19:07:30 +02:00

24 lines
496 B
PowerShell
Executable File

param (
[Parameter(Mandatory=$true)]
[string]
$TargetPath,
[Parameter(Mandatory=$true)]
[string]
$OutputLnk,
[Parameter(Mandatory=$false)]
[string]
$Arguments = "",
[Parameter(Mandatory=$false)]
[string]
$WorkingDirectory = ""
)
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($OutputLnk)
$Shortcut.TargetPath = $TargetPath
$Shortcut.Arguments = $Arguments
$Shortcut.WorkingDirectory = $WorkingDirectory
$Shortcut.Save()