22 lines
639 B
PowerShell
22 lines
639 B
PowerShell
# Get Startup folder path
|
|
$startup = [Environment]::GetFolderPath('Startup')
|
|
$batPath = "E:\GitHub\blog\write\start-silent.bat"
|
|
$vbsPath = Join-Path $startup "WriteBot.vbs"
|
|
|
|
# Create VBS wrapper for silent execution (no cmd window)
|
|
$vbs = @"
|
|
Set WshShell = CreateObject("WScript.Shell")
|
|
WshShell.Run Chr(34) & "$batPath" & Chr(34), 0, False
|
|
Set WshShell = Nothing
|
|
"@
|
|
|
|
$vbs | Out-File -FilePath $vbsPath -Encoding ASCII
|
|
|
|
# Verify
|
|
if (Test-Path $vbsPath) {
|
|
Write-Host "WriteBot startup script installed to: $vbsPath"
|
|
Write-Host "It will start silently on Windows login."
|
|
} else {
|
|
Write-Host "Failed to install startup script."
|
|
}
|