תסריט הפאוארשל הבא, משיג את רוב המידע הרלוונטי השמור בקיצור דרך
התסריט הבא יוצר / עורך כל קיצור דרך בנפרד
[/CODE]
[/CODE]
[/CODE]
[/CODE]
[/CODE]
[/CODE]
קוד:
$Links = GCI -Path "D:\" -Filter *.lnk | Select-Object Name, FullName
foreach ($link in $Links) {
# Get Shortcut Info
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($link.FullName)
$RequiresAdmin = $Shortcut.TargetPath -match 'RunAs.exe'
#
Write-Host "FullName: $($link.FullName)"
Write-Host "Target Path: $($Shortcut.TargetPath)"
Write-Host "Arguments: $($Shortcut.Arguments)"
Write-Host "Description: $($Shortcut.Description)"
Write-Host "Working Directory: $($Shortcut.WorkingDirectory)"
Write-Host "Hotkey: $($Shortcut.Hotkey)"
Write-Host "Icon Location: $($Shortcut.IconLocation)"
Write-Host "Window Style: $($Shortcut.WindowStyle)"
Write-Host "Target Type: $($Shortcut.TargetType)"
Write-Host "Relative Path: $($Shortcut.RelativePath)"
Write-Host "RequiresAdmin: $($Shortcut.RequiresAdmin)"
Write-Host "=================================" -ForegroundColor Yellow -BackgroundColor Black
}
#
התסריט הבא יוצר / עורך כל קיצור דרך בנפרד
קוד:
# Edit Shortcut
$FullName = "D:\Path\To\Your\Shortcut.lnk" # יש להשלים את הנתיב לקובץ .lnk
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($FullName)
#
$Shortcut.TargetPath = "C:\Windows\System32\Shutdown.exe"
$Shortcut.Arguments = ""
$Shortcut.Description = "Anything"
$Shortcut.WorkingDirectory = "C:\Windows\System32"
$Shortcut.Hotkey = ""
$Shortcut.IconLocation = ""
$Shortcut.WindowStyle = 1
$Shortcut.Save()
[/CODE]
[/CODE]
[/CODE]
[/CODE]
[/CODE]
[/CODE]
נערך לאחרונה ב: