dupa

Author Topic: Is it possible to shut down Win10 via a Hal command?  (Read 3560 times)

Checker57

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Is it possible to shut down Win10 via a Hal command?
« on: April 16, 2021, 01:37:36 am »
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?

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

Rem PLUGIN: PRE-PROCESS
    '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
Rem PLUGIN: FUNCTIONS
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
   objOS.Reboot()
NEXT
End Function


cyber

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.

Honvai

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Is it possible to shut down Win10 via a Hal command?
« Reply #1 on: April 17, 2021, 10:57:06 pm »
Can hal open .bat files?

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Is it possible to shut down Win10 via a Hal command?
« Reply #2 on: April 18, 2021, 07:52:28 am »
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.

In the world of AI it's the thought that counts!

- Art -

Checker57

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: Is it possible to shut down Win10 via a Hal command?
« Reply #3 on: June 18, 2021, 11:21:33 pm »
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!
cheers!

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Is it possible to shut down Win10 via a Hal command?
« Reply #4 on: June 19, 2021, 08:02:06 am »
oh ud be surprised whats coming


all kinda bling

cyber