What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Help » Starting Messenger conversation from DOS command line?

Starting Messenger conversation from DOS command line?
Author: Message:
glenncarr
New Member
*


Posts: 3
Joined: Feb 2010
O.P. Starting Messenger conversation from DOS command line?
I'm a new user of Messenger Plus, but was wondering/hoping that it might provide a way to start a Messenger conversation from a DOS command line (on Vista in my case).

Any one know of any way to do this?

Thanks!
02-03-2010 03:55 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Starting Messenger conversation from DOS command line?
Not sure it's possible, but why would you want to do that?
<Eljay> "Problems encountered: shit blew up" :zippy:
02-03-2010 04:09 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Starting Messenger conversation from DOS command line?
You would need a script and an executable to achieve such a thing.
02-03-2010 04:42 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Starting Messenger conversation from DOS command line?
quote:
Originally posted by matty
You would need a script and an executable to achieve such a thing.

That was my next reply ¬_¬ Although, would it actually need a script or could you just use the API (I know there are some issues where using the API opens an instance of Windows Messenger)
<Eljay> "Problems encountered: shit blew up" :zippy:
02-03-2010 05:11 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Starting Messenger conversation from DOS command line?
I would do it how it was done with SendTo.
02-03-2010 05:58 PM
Profile E-Mail PM Find Quote Report
glenncarr
New Member
*


Posts: 3
Joined: Feb 2010
O.P. RE: Starting Messenger conversation from DOS command line?
quote:
Originally posted by Spunky
Not sure it's possible, but why would you want to do that?
Because I want to :) ... I use the command prompt and specifically SlickRun for a lot of may day-to-day development work.  I'm just a command-line kinda guy.
02-03-2010 10:28 PM
Profile E-Mail PM Find Quote Report
glenncarr
New Member
*


Posts: 3
Joined: Feb 2010
O.P. RE: RE: Starting Messenger conversation from DOS command line?
quote:
Originally posted by krissy-afc
quote:
Originally posted by glenncarr
quote:
Originally posted by Spunky
Not sure it's possible, but why would you want to do that?
Because I want to :) ... I use the command prompt and specifically SlickRun for a lot of may day-to-day development work.  I'm just a command-line kinda guy.
Or just a wanna be show of hacker to-your-friends.

Uhmm, no.


Here's a script I threw together which sort of works, but only if the main Messenger client isn't already active.  The AppActivate doesn't bring it to the foreground if the window already exists.

code:
args = WScript.Arguments
var WshShell = new ActiveXObject("WScript.Shell");

WshShell.Run( 'msnmsgr.exe' )
WScript.Sleep( 200 )
   
WshShell.AppActivate( 'Windows Live Messenger' )
WScript.Sleep( 200 )

WshShell.SendKeys( "%AS")
WScript.Sleep( 200 )
WshShell.SendKeys( "%D")
if ( args.length >= 1 )
{
    WshShell.SendKeys( args( 0 ) ) // Contact name
    WScript.Sleep( 200 )
    WshShell.SendKeys( "{ENTER}")

    if ( args.length >= 2 )
    {
        WshShell.SendKeys( args( 1 ) ) // Message
        WScript.Sleep( 200 )
        WshShell.SendKeys( "{ENTER}")
    }
}


Anyway, I'll dig around a while.  Thanks, (and I glad I could impress you  by wanting to use the command-line.  old geezer command-line guys like me are cool ;) )

EDIT: Using AutoIt works consistently (if anyone cares)...


code:
; im.au3
Run( "C:\Program Files (x86)\Windows Live\Messenger\msnmsgr.exe" )
WinWaitActive( "Windows Live Messenger" )
Send( "!AS" )
WinWaitActive( "Send an Instant Message" )
Send( "!D" )
If $CmdLine[ 0 ] >= 1 Then
    Send( $CmdLine[ 1 ] )
    Sleep( 200 )
    Send( "{ENTER}" )
    If $CmdLine[0] >= 2 Then
        $msg = StringRight( $CmdLineRaw, StringLen( $CmdLineRaw ) - StringLen( @ScriptFullPath ) - 2 ) ; 2 for quotes
        $msg = StringRight( $msg, StringLen( $msg ) - StringLen( $CmdLine[ 1 ] ) - 3 )
        Send( $msg )
    EndIf
EndIf


Usage: im.au3 <contact name> [message]

Cheers. (Y)

This post was edited on 02-04-2010 at 05:53 AM by glenncarr.
02-04-2010 12:05 AM
Profile E-Mail PM Find Quote Report
« 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