Create Win_Shortcut_Creator.ps1

This commit is contained in:
agit8or 2021-05-18 13:00:26 -04:00 committed by GitHub
parent e848a9a577
commit 870bf842cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
md -Path 'C:\agent' -Force
wget "http://www.yourwebsite.com/logos/yourico.ico" -outfile "c:\agent\yourico.ico"
$WshShell = New-Object -comObject WScript.Shell
$path = "C:\Users\All Users\desktop\Jaxsupport.url"
$targetpath = "https://yourwebsite.com"
$iconlocation = "c:\agent\yourico.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"
# This will create and agent directory then download the ico file
# change ico file and location to download