Here is a script that allows you to connect to a user's machine and start a Remote Assistance session without the user having to interact with the connection initialisation procedure. Sounds naughty but you have to be a local admin of the target machine and that machine has to have it's firewall off etc, i.e. a corporate domain environment.
About 10% of the time it fails to connect and it copies some modified operating system files to the target client first. Get modified files here.
RA.ZIP I don't use this script anymore because we use SMS remote control or
Dameware which also kicks you straight into a remote control session, but someone may find this script useful or make it better. Read script comments before running it, have fun.
'Remote Assistance launch Script by MJP 2006
'XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2-XP SP2
'can be launched from command line with variables
'1st variable is machine name, 2nd variable is connection method
'Or Just click on RA-offer.vbs to run
'Script copies modified RA files to remote client in case you want to remote assist without explicit permission
'Script restores the original client files with "My Copy" after 60 seconds, so take control before then please.
'To make it clear - Answer "No" in order to intiate hacked version of Remote Assistance
'Don't touch keyboard or mouse while sendkeys part of script is running.
' ********************************************************************************************
' *RUN SCRIPT IN TEST ENVIRONMENT FIRST AND TAKE BACKUP COPIES OF YOUR OWN CLIENT'S RA FILES.*
' *THIS SCRIPT WILL MODIFY THE TARGET MACHINE WITH MY ORIGINAL COPIES OF THE RA FILES. *
' ********************************************************************************************
'Tested as domain admin and occassionally fails to connect, XP SP2 target machines on network need firwall turned off.
'NO WARRANTY - USE AT YOUR OWN RISK
Option explicit
'Declare Variables
dim strComputerName
Dim RA
Dim shell
dim answer
Dim objFSO
Dim objWSH
'Check if a cmd line variable was passed to script for pc or ask for pc name
On Error Resume next
strComputerName=WScript.Arguments.Item(0)
On Error Goto 0
Set shell = createobject("wscript.shell")
If strComputerName="" Then
strComputerName=inputbox("Enter PC Name:")
End If
'Determine if remote computer is on and accessable
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("\\"&strComputerName&"\c$\WINDOWS\PCHealth\HelpCtr\System\Remote Assistance\helpeeaccept.htm") Then
' continue script is ok
Else
Wscript.Echo "Machine "&strComputerName&" is not accessable, ie, does not appear to be turned on"
wscript.quit
End If
'Check if a cmd line variable was passed to script for method
On Error Resume next
answer=WScript.Arguments.Item(1)
On Error Goto 0
Set shell = createobject("wscript.shell")
If answer="" Then
'Ask for RA permission or go straight in
answer=MsgBox("Click YES for Remote Assistance to operate normally",36,"Ask Permission?")
Else
If answer="yes" Then
answer=6
End if
If answer="no" Then
answer=7
End If
If answer=7 Or answer=6 Then
'
Else
answer=MsgBox("Click YES for Remote Assistance to operate normally",36,"Ask Permission?")
End if
End If
If answer=7 Then
'answer=7 NO
'copy SZY's modified RA files to remote client
Const OverWriteFiles = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder ScriptPath&"\NO\Remote Assistance" , "\\"&strComputerName&"\c$\WINDOWS\PCHealth\HelpCtr\System\" , OverWriteFiles
RALaunch
'restore MJP's XP S2 original RA files back to client
'Set objWSH = WScript.CreateObject("Wscript.Shell")
'objWSH.Popup "Press ok button to make RA client prompt for permission on future connection attempts on this client", 60, "Restore?", vbOKonly
Wscript.Sleep 60000 'give admin a one minute window to initiate remote control
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder ScriptPath&"\YES\Remote Assistance" , "\\"&strComputerName&"\c$\WINDOWS\PCHealth\HelpCtr\System\" , OverWriteFiles
WScript.Quit
End If
If answer=6 Then
'answer=6 YES
RALaunch
WScript.Quit
End if
'Launch Remote Assistance
Sub RALaunch
shell.run "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm"
RA="Help and Support Center"
Do until shell.AppActivate (RA)
Wscript.Sleep 5
shell.AppActivate (RA)
loop
wscript.sleep 2000
Do until shell.AppActivate (RA)
Wscript.Sleep 5
shell.AppActivate (RA)
loop
shell.sendkeys strComputerName
wscript.sleep 500
Do until shell.AppActivate (RA)
Wscript.Sleep 5
shell.AppActivate (RA)
loop
shell.sendkeys "%c"
wscript.sleep 500
Do until shell.AppActivate (RA)
Wscript.Sleep 5
shell.AppActivate (RA)
loop
shell.sendkeys "%s"
End Sub
'Determine path script is running from
Function ScriptPath()
ScriptPath = Left(WScript.ScriptFullName, _
Len(WScript.ScriptFullName) - Len(WScript.ScriptName))
End Function
<message edited by Meg on Wednesday, September 26, 2007 1:15 AM>