Shaun Cassells at MyITForum.com

SMS 2003 and ConfigMgr 2007, PowerShell, Scripting, Finance, Fitness and Fun

News

Locations of visitors to this page

Fun with Office Assistant Merlin in VB

The following simple VB script will bring up a Merlin Office Assistant and move him around.  The MoveTo locations assume dual monitors.  This was originally created to annoy coworkers who did not lock their workstation when leaving for meetings. Enjoy.  

'Created by Shaun Cassells
''''''''''''''''''''''''''''''''''''''''
agFl = "C:\Windows\Msagent\Chars\merlin.acs"
'''''''''''''''''''''''''''''''''''''''''''

'Create an MSAgent Object
Set objAgent = CreateObject("Agent.Control.2")

objAgent.Connected = TRUE
'Load the Merlin as the current char
objAgent.Characters.Load "Merlin", agFl

'generate a character object for the agent object
Set objCharacter = objAgent.Characters.Character("Merlin")

'Show the Agent
objCharacter.Show
'Make it animate and talk
objCharacter.Play "GetAttention"
objCharacter.Play "GetAttention"
objCharacter.MoveTo 500,400
objCharacter.Play "Announce"
objCharacter.Speak "Remember Kids, Be cool Lock your Computer!"
objCharacter.Play "Surprised"
objCharacter.Speak "Jeremy Clarckson, say's that is a lot of Torques!"
objCharacter.Play "Pleased"
objCharacter.Think "Maybe I should move around a little ...."
objCharacter.MoveTo 1500,400
objCharacter.Play "Alert"
objCharacter.Speak "Hey you!"
objCharacter.GestureAt 800, 0
objCharacter.Speak "Yeah You!"
objCharacter.Play "Congratulate"
objCharacter.Speak "Lock your puter!"
objCharacter.Play "Congratulate_2"

 


'Now hide the agent
objCharacter.Hide

'The below three lines are very important for the correct functioning of the agent char. else
' the script will conclude it's execution even before the character is loaded
'on the screen
Do While objCharacter.Visible = TRUE
'This makes the script wait until the objCharacter.Hide statement is executed
    Wscript.Sleep 250
Loop

'End of Script

Comments

kingskawn said:

How can I execute this VB on some machines?

# January 10, 2009 7:04 PM

scassells said:

Hi,  there are several methods to execute remotely.  SMS, SCCM, or PSExec.  The trick is you need to run the application in a normal window and allow the end user to interact.

PSexec example:

psexec -c -f -i \\MachineName Merlin.vbs

# January 12, 2009 9:09 AM