Alatyami
NotAddicted.com Engineer (Retired)
- Joined
- Dec 21, 2004
- RedCents
- 804¢
I had to take a break from working on the buff plugin for TheZ ...
MQ2Shutdown, will do just as it implies ... it will shutdown your computer, by send Microsoft Windows the shutdown command. How is this helpful? There are a few times that I know that my macro is only going to run for a set time period and then my desktop is just going to sit there doing nothing, so now once my macro is completed, it shuts down my desktop.
This is a very simple plugin.
Edit: Updated Compiled Library to Version 1.2, that includes the /logout and /reboot
Usage:
Source Code (VC++ 2003):
MQ2Shutdown, will do just as it implies ... it will shutdown your computer, by send Microsoft Windows the shutdown command. How is this helpful? There are a few times that I know that my macro is only going to run for a set time period and then my desktop is just going to sit there doing nothing, so now once my macro is completed, it shuts down my desktop.
This is a very simple plugin.
Edit: Updated Compiled Library to Version 1.2, that includes the /logout and /reboot
Usage:
Rich (BB code):
/shutdown
/reboot
/logout
Source Code (VC++ 2003):
Rich (BB code):
// MQ2Shutdown.cpp
// Author: Alatyami, Redguides.com, 2007
//
// This plugin allows your to shutdown, reboot, or logout of MS Windows.
//
// MOD NOTES:
// 01/24/2007 Initial Release. - Alatyami
// Made the SystemRoot Dynamic - Alatyami
// 01/25/2007 Added /logout and /reboot - Alatyami
//
// USAGE:
// /shutdown ** Shutsdown and powers off Windows.
// /logout ** Closes out all running apps and logs out of Windows
// /reboot ** Closes out all running apps and reboots your machine.
#include "../MQ2Plugin.h"
#include <stdlib.h>
PreSetup("MQ2Shutdown"); PLUGIN_VERSION(1.2);
// PROTOTYPES
void shutdownCommand(PSPAWNINFO pChar, PCHAR szLine);
void rebootCommand(PSPAWNINFO pChar, PCHAR szLine);
void logoutCommand(PSPAWNINFO pChar, PCHAR szLine);
// FUNCTIONS
void shutdownCommand(PSPAWNINFO pChar, PCHAR szLine) {
system("\%SystemRoot\%\\System32\\shutdown.exe -s -f -t 00");
}
void rebootCommand(PSPAWNINFO pChar, PCHAR szLine) {
system("\%SystemRoot\%\\System32\\shutdown.exe -r -f -t 00");
}
void logoutCommand(PSPAWNINFO pChar, PCHAR szLine) {
system("\%SystemRoot\%\\System32\\shutdown.exe -l -f -t 00");
}
PLUGIN_API VOID InitializePlugin(VOID) {
DebugSpewAlways("Initializing MQ2Shutdown");
AddCommand("/shutdown",shutdownCommand);
AddCommand("/reboot",rebootCommand);
AddCommand("/logout",logoutCommand);
}
PLUGIN_API VOID ShutdownPlugin(VOID) {
DebugSpewAlways("Shutting down MQ2Shutdown");
RemoveCommand("/shutdown");
RemoveCommand("/reboot");
RemoveCommand("/logout");
}
Last edited:


