Files
blog/fix-shortcut.ps1
T
2026-06-01 17:57:22 +08:00

16 lines
607 B
PowerShell

$startup = [Environment]::GetFolderPath("Startup")
$shortcutPath = Join-Path $startup "WriteBot.lnk"
$icoPath = "E:\GitHub\blog\bot\writebot.ico"
$wsh = New-Object -ComObject WScript.Shell
$shortcut = $wsh.CreateShortcut($shortcutPath)
$shortcut.TargetPath = "C:\nvm4w\nodejs\node.exe"
$shortcut.Arguments = "index.js"
$shortcut.WorkingDirectory = "E:\GitHub\blog\bot"
$shortcut.WindowStyle = 7
$shortcut.Description = "WriteBot"
$shortcut.IconLocation = "$icoPath,0"
$shortcut.Save()
Write-Host "Startup shortcut updated: $shortcutPath"
Write-Host "Target: node.exe index.js (cwd: E:\GitHub\blog\bot)"