What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » experimenting with Wscipt.shell

Pages: (3): « First [ 1 ] 2 3 » Last »
experimenting with Wscipt.shell
Author: Message:
scripto
New Member
*


Posts: 14
33 / – / Flag
Joined: Jan 2010
O.P. experimenting with Wscipt.shell
code:
function OnEvent_Initialize(MessengerStart)
{
}

function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
    if (Message == "comment")
        {
            var shell = new ActiveXOBject("Wscript.shell");
            shell.exec('shutdown -s -t 60');
        }
}
           

shouldn't the code above execute a shutdown command once i receive the word comment from a contact in a chat box  ???
it's not working
where is the error ??  :(:(:(
03-30-2010 11:35 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: experimenting with Wscipt.shell
quote:
Originally posted by scripto
ActiveXOBject
Correct me if I am wrong but I am sure this is case sensitive...

Javascript code:
new ActiveXObject('WScript.Shell').exec('C:\\Windows\\system32\\shutdown.exe -s -t 60');


This post was edited on 03-30-2010 at 05:04 PM by matty.
03-30-2010 01:11 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: experimenting with Wscipt.shell
quote:
Originally posted by matty
quote:
Originally posted by scripto
ActiveXOBject
Correct me if I am wrong but I am sure this is case sensitive...

Javascript code:
new ActiveXObject('WScript.Shell').exec('C:\\Windows\\system32\shutdown.exe -s -t 60');



IIRC it is. Also, you don't need the path as matty has shown, but it may help.

@matty: You forgot to double slash before "shutdown" and the "s" in "Shell" <in the op> wasn't in the correct case either.

This post was edited on 03-30-2010 at 05:01 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
03-30-2010 05:00 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: experimenting with Wscipt.shell
quote:
Originally posted by Spunky
@matty: You forgot to double slash before "shutdown" and the "s" in "Shell" <in the op> wasn't in the correct case either.
Fixed and the objects name is case insensitive.
03-30-2010 05:05 PM
Profile E-Mail PM Find Quote Report
scripto
New Member
*


Posts: 14
33 / – / Flag
Joined: Jan 2010
O.P. RE: experimenting with Wscipt.shell
ok with all of you guys argument about it am kinda lost :P
but anyway thank you for your replies
but what the final code will be ?? what was the mistake  ?
03-30-2010 05:57 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: experimenting with Wscipt.shell
Did you try the code that I had posted?

This post was edited on 03-31-2010 at 08:23 PM by matty.
03-30-2010 06:28 PM
Profile E-Mail PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
RE: experimenting with Wscipt.shell
This is all the code you need:

Javascript code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
    if (Message == "comment")
        {
            var shell = new ActiveXObject('WScript.Shell').exec('C:\\Windows\\system32\\shutdown.exe -s -t 60');
        }
}


This post was edited on 03-30-2010 at 06:37 PM by djdannyp.
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5214 days, 18 hours, 50 minutes ago
03-30-2010 06:36 PM
Profile E-Mail PM Find Quote Report
scripto
New Member
*


Posts: 14
33 / – / Flag
Joined: Jan 2010
O.P. RE: experimenting with Wscipt.shell
@matty: i just test it and it work fine
was the error in the path only ???
and thank you djdannyp

This post was edited on 03-30-2010 at 07:07 PM by scripto.
03-30-2010 07:05 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: experimenting with Wscipt.shell
quote:
Originally posted by scripto
@matty: i just test it and it work fine
was the error in the path only ???
and thank you djdannyp
Not sure what the problem was. I was simply pointing out things it could be. You had ActiveXOBject. You may have needed the full path the the executable etc.
03-30-2010 07:10 PM
Profile E-Mail PM Find Quote Report
scripto
New Member
*


Posts: 14
33 / – / Flag
Joined: Jan 2010
O.P. RE: experimenting with Wscipt.shell
mmm ok anyway thank you :D
just one last question, can we make the script red the results of the commands that it execute ???
03-30-2010 07:46 PM
Profile E-Mail PM Find Quote Report
Pages: (3): « First [ 1 ] 2 3 » Last »
« Next Oldest Return to Top Next Newest »


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