-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinst.ps1
19 lines (15 loc) · 892 Bytes
/
inst.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function set-shortcut {
param ( $SourceLnk, $DestinationPath, $Parameters, $workdir, $icoloc )
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($SourceLnk)
$Shortcut.TargetPath = $DestinationPath
$Shortcut.Arguments = $Parameters
$Shortcut.WorkingDirectory = $workdir
$Shortcut.IconLocation = $icoloc
$Shortcut.Save()
}
Set-Location -LiteralPath $PSScriptRoot
New-Item -Path "$env:HOMEDRIVE$env:HOMEPATH\SetScanner" -ItemType Directory
copy-item .\files\* $env:HOMEDRIVE$env:HOMEPATH\SetScanner -Force -Recurse
unblock-File $env:HOMEDRIVE$env:HOMEPATH\SetScanner\*
set-shortcut "$env:HOMEPATH\Desktop\SetScanner.lnk" "powershell.exe" "-File $env:HOMEDRIVE$env:HOMEPATH\SetScanner\launcher.ps1" "$env:HOMEDRIVE$env:HOMEPATH\SetScanner" "$env:HOMEDRIVE$env:HOMEPATH\SetScanner\icon.ico"