What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Shutdown script help

Shutdown script help
Author: Message:
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: Shutdown script help
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if (Message.substring(0,9) == "/shutdown")
new ActiveXObject("wscript.shell").run("shutdown.exe -s -f");
else if (Message.substring(0,7) == "/reboot")
new ActiveXObject("wscript.shell").run("shutdown.exe -r -f");
}

you have to return the message or it will give an error...
try:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if (Message.substring(0,9) == "/shutdown")
new ActiveXObject("wscript.shell").run("shutdown.exe -s -f");
else if (Message.substring(0,7) == "/reboot")
new ActiveXObject("wscript.shell").run("shutdown.exe -r -f");
return "";
}

ChatWndRecieve needs another parameter:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind ){


This post was edited on 05-24-2008 at 11:54 AM by foaly.
05-24-2008 11:52 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Shutdown script help - by hello123456 on 05-24-2008 at 11:49 AM
RE: Shutdown script help - by foaly on 05-24-2008 at 11:52 AM
RE: Shutdown script help - by hello123456 on 05-24-2008 at 12:28 PM
RE: Shutdown script help - by foaly on 05-24-2008 at 12:36 PM
RE: Shutdown script help - by hello123456 on 05-24-2008 at 12:41 PM
RE: Shutdown script help - by foaly on 05-24-2008 at 12:46 PM
RE: Shutdown script help - by hello123456 on 05-24-2008 at 12:53 PM
RE: Shutdown script help - by linx05 on 05-25-2008 at 08:25 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On