| View previous topic :: View next topic |
| Author |
Message |
jargha
Joined: 28 Jan 2007 Posts: 1
Digg It |
Posted: Sun Jan 28, 2007 11:05 pm Post subject: WindowsXP Shutdown Script? |
|
|
Hello all,
I have just been playing around with GlovePie and my Wiimote since just a few hours ago and wrote my first script to control VLCPlayer. I would like to add functionality to the script to shutdown windows but am having some problems - has anyone else tried this?
I tried:
| Code: | Alt+F4 = Wiimote.B // Quit
Alt+u = Wiimote.Down |
1. From any application, pressing the 'B' button quits the program.
2. A subsequent press of the 'B' button brings up the Windows XP shutdown dialog (with three options - 'Standby', 'Turn Off' & 'Restart')
3. A press of the D-Pad Down button now chooses the 'Turn Off' (Alt+u) option which should shutdown Windows
However, after Step 3 above I hear a 'beep' and Windows fails to shutdown. Is this because Windows is not allowed to shutdown whilst GlovePie is running? If I try to manually shutdown Windows while GlovePie is running (just using the mouse), I hear the same 'beep' and Windows does not shutdown...
Anyone know how this can be solved?
jAH |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Sun Jan 28, 2007 11:28 pm Post subject: |
|
|
| There's a command called ExitPIE that closes GlovePIE, but I've never used it before. I'm not sure how you'd go about using it in this case, though. You probably want to close down GlovePIE before Alt + U is pressed, but doing the first would cancel the second. You might try having it send the Alt + U and then closing GlovePIE. It might close before Windows decides to complain about it. |
|
| Back to top |
|
 |
kUrRaZyMaN
Joined: 17 Feb 2007 Posts: 1
Digg It |
Posted: Sat Feb 17, 2007 1:27 pm Post subject: windows xp shutdown script? |
|
|
The best way to do this would be to create a batch file containing:
shutdown -s -t 30
You can then execute this from glovepie using Execute("C:\shutdown.bat") - obviously change the path to wherever you decide to store the batch file. Once executed you can then shutdown glovepie using the Exitpie command.
Haven't tried any of this but it should work OK |
|
| Back to top |
|
 |
speaker219
Joined: 28 Jan 2007 Posts: 187 Location: New York
Digg It |
Posted: Sat Feb 17, 2007 3:27 pm Post subject: Re: windows xp shutdown script? |
|
|
| kUrRaZyMaN wrote: | The best way to do this would be to create a batch file containing:
shutdown -s -t 30
You can then execute this from glovepie using Execute("C:\shutdown.bat") - obviously change the path to wherever you decide to store the batch file. Once executed you can then shutdown glovepie using the Exitpie command.
Haven't tried any of this but it should work OK |
Yes, it would work perfectly if you made a batch file for example in (C:\other)
then in your glovepie script have something like:
| Code: | Execute("C:\other\shutdown.bat") = Wiimote.A
ExitPie |
I know this would work because I made a script to hibernate my computer, and if you wanted to do that put this in the batch file:
| Code: | | rundll32.exe PowrProf.dll,SetSuspendState |
|
|
| Back to top |
|
 |
SwedishFrog Site Admin

Joined: 25 Jan 2007 Posts: 273 Location: New York
Digg It |
Posted: Sat Feb 17, 2007 3:32 pm Post subject: |
|
|
There's also a windows library function that shuts down windows. I don't remember the exact name of the call, but it's there and you can google it.
Normal keystroke programming may not work effectively cause the xp shutdown box is a special window. This may be some sort of security measure -- I dunno I don't have a computer to test it on.
You should consider moving the alt-f4 keystroke to some other button besides wiimote.b because its easy to hit B by accident, for instance, when you put the controller down. |
|
| Back to top |
|
 |
|