# 等待登录成功（一次）
do {
    Start-Sleep -Seconds 2
    $evt = Get-WinEvent -FilterHashtable @{
        LogName = 'Security'
        Id      = 4624
    } -MaxEvents 1 -ErrorAction SilentlyContinue
} until ($evt)

# 等待 Explorer 就绪
while (-not (Get-Process explorer -ErrorAction SilentlyContinue)) {
    Start-Sleep -Seconds 1
}

# 触发用户态任务（一次）
Start-ScheduledTask -TaskName "启动"

exit
