SemlerPDX icon

Monitor VoiceAttack for Crash and Restart as Admin with UAC at High via Scheduled Task

SemlerPDX | PRO | 11/18/20 07:02:51 PM UTC (Edited) | 0 ⭐ | 2917 👁️ | Never ⏰ | []
PowerShell |

1.94 KB

|

None

|

0 👍

/

0 👎

#VoiceAttack restart by SemlerPDX May2020/Aug2020
#uses Windows Task to launch VoiceAttack as Admin while bypassing UAC
#current task is set to ensure Logitech G933 is set as input device, to my ".Malcolm for VAS90" profile
 
#Find complete instructions for Launching VoiceAttack as Admin under High UAC Settings with no UAC Prompt here:
#     https://forum.voiceattack.com/smf/index.php?topic=3517.msg16179
 
 
# Launch VoiceAttack if not running
if (!(Get-Process -Name VoiceAttack*)) {
    clear
    # Process Begin
    $bTimeDown = 3
    for($b=$bTimeDown; $b -gt -1; $b--) {
        write-host "Starting VoiceAttack in $($b) seconds..."
        start-sleep -seconds 1
        clear
    }
    write-host "$(Get-Date) - Launching VoiceAttack to .Malcolm for VAS90..."
    start-sleep -seconds 1
    if (!(Get-Process -Name VoiceAttack*)) {
        Start-ScheduledTask -TaskName "VAnoUACg933"
    }
}
 
# Delayed Monitor Start
$dTimeDown = 15
for($d=$dTimeDown; $d -gt -1; $d--) {
    write-host "Starting Crash Monitor for VoiceAttack in $($d) seconds..."
    start-sleep -seconds 1
    clear
}
 
write-host "$(Get-Date) - Monitoring VoiceAttack for crashes..."
# VoiceAttack Crash Monitor Loop
do {
    start-sleep -seconds 1
    if (!(Get-Process -Name VoiceAttack*)) {
        clear
        # Crash Handle Start
        $sTimeDown = 4
        for($s=$sTimeDown; $s -gt -1; $s--) {
            write-host "$(Get-Date) - .Malcolm for VAS90 has crashed VoiceAttack.... Restarting in $($s) seconds..."
            start-sleep -seconds 1
            clear
        }
        write-host "$(Get-Date) - Launching VoiceAttack to .Malcolm for VAS90..."
        start-sleep -seconds 1
        if (!(Get-Process -Name VoiceAttack*)) {
            Start-ScheduledTask -TaskName "VAnoUACg933"
        }
        clear
        # Delayed Monitor Start
        $rTimeDown = 15
        for($r=$rTimeDown; $r -gt -1; $r--) {
            write-host "Starting Crash Monitor for VoiceAttack in $($r) seconds..."
            start-sleep -seconds 1
            clear
        }
        write-host "$(Get-Date) - Monitoring VoiceAttack for crashes..."
    }
} while ($true)

Comments