wip addition create shortcut to URL

This commit is contained in:
silversword411 2021-05-14 17:50:50 -04:00
parent c9dd2af196
commit d1457b312b
No known key found for this signature in database
GPG Key ID: 6F4BD176F56B50CA
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Needs to be parameterized: $icofile, $URL, $ShortcutPath
# Need to change paths and test/create if don't exist
wget "https://www.example.com/logos/example.ico" -outfile "c:\agent\example.ico"
$WshShell = New-Object -comObject WScript.Shell
$path = "C:\Users\All Users\desktop\example.url"
$targetpath = "https://example.com/"
$iconlocation = "c:\agent\example.ico"
$iconfile = "IconFile=" + $iconlocation
$Shortcut = $WshShell.CreateShortcut($path)
$Shortcut.TargetPath = $targetpath
$Shortcut.Save()
Add-Content $path "HotKey=0"
Add-Content $path "$iconfile"
Add-Content $path "IconIndex=0"