Zabaware Forums > Ultra Hal Assistant File Sharing Area

Is it possible to shut down Win10 via a Hal command?


Sometimes, just before closing my eyes and off to lala land, I speak via mic to HAL and throw out last minute thoughts... then use a Bluetooth remote mouse to shut down the PC.  It would be rather convenient to simply command HAL to close and shut down PC.

The following post CyberJedi posted a while back got me thinking it may be possible.  Cyber, if you're up and got a free cycle, would this code work with Win10?

--- Quote from: cyberjedi on May 06, 2020, 01:33:14 pm ---Will and MR data: Re shut down

I seem to remember that u said ur still running xp

Here ya go

Rem Type=Plugin
Rem Name= Shut down
Rem Author=
Rem Host=All

    'The preceding comment is actually a plug-in directive for
    'the Ultra Hal host application. It allows for code snippets
    'to be inserted here on-the-fly based on user configuration.

HalBrain.ReadOnlyMode = True
'Determines that you are talking about the Computer shutdown
If InStr(1,InputString, "trigger goes here",1) > 0 Then
 UltraHal = GetShutDown(HalCommands)
ElseIf InStr(1,InputString, "Trigger goes here",1) > 0 Then
 End If
Function GetShutDown(HalCommands)
strComputer = "." ' Local Computer
SET objWMIService = GETOBJECT("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" & _
         strComputer & "\root\cimv2")
SET colOS = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
FOR EACH objOS in colOS
End Function


its been Revised to reBoot status, ssry
Will, i dont have an XP machine any more so im unable to test, please forgive... I think im spot on.

--- End quote ---

Can hal open .bat files?

Well, there is a Plugin called Runprog or something similar.

Basically, it can/will run a program that you tell it to like "Run Paint" or in your case, "Run XXX.bat"

You might have to examine the Plugin to see if it is able to handle .bat files or the structure required but I think it's definitely possible.

Just to update this thread (like a very belated birthday wish) I found it quite easy to have that runprog uph file accept my verbal command to "Execute "shut down"" which is what I called the bat file.  And my adoring AI "will comply".  Also, using a smart power strip that will shut down all dependent devices to my PC, once the pc shuts down, so does the monitor, speakers, and even the desk lamp... and beddy-bye we all go.

Now, voice commanding the PC to turn on when shut off, that's above my pay-grade.  :P

Pretty cool!

oh ud be surprised whats coming

all kinda bling



[0] Message Index

Go to full version