Files
blog/install-startup.ps1
T

18 lines
700 B
PowerShell
Raw Normal View History

2026-06-01 17:57:22 +08:00
$startup = [Environment]::GetFolderPath("Startup")
$shortcutPath = Join-Path $startup "WriteBot.lnk"
$targetPath = "E:\GitHub\blog\bot\start-tray.vbs"
$wsh = New-Object -ComObject WScript.Shell
$shortcut = $wsh.CreateShortcut($shortcutPath)
$shortcut.TargetPath = "wscript.exe"
$shortcut.Arguments = "`"$targetPath`""
$shortcut.WorkingDirectory = "E:\GitHub\blog\bot"
$shortcut.WindowStyle = 7 # Minimized
$shortcut.Description = "WriteBot tray launcher"
$shortcut.IconLocation = "wscript.exe,0"
$shortcut.Save()
Write-Host "Startup folder: $startup"
Write-Host "Shortcut created: $shortcutPath"
Write-Host ""
Get-ChildItem -LiteralPath $shortcutPath | Format-List Name, FullName, LastWriteTime