Offer Remote Assistance in Windows XP Professional

You may also like...

18 Responses

  1. Lewis says:

    I made a start (that means I’ve not finished) on the connection script.

    So far it checks for the machine on the network, connects to it, backs up the existing files, edits the originals, opens offer remote assistance and bobs yer uncle… importantly it doesn’t change the changes back so don’t say I didn’t warn you!

    Here you go:


    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    Set oSh = CreateObject("WScript.Shell")
    Set oFs = CreateObject("Scripting.FileSystemObject")

    sComputerName = InputBox ("Type the computer name of the user you wish to offer assistance to...", "Offer Assistance")
    sTargetPath = "\C$\WINDOWS\pchealth\helpctr\System\Remote~1\"

    If sComputerName = "" Then
    oSh.Popup "No name entered.", 2, "Warning", 0 + 4096
    WScript.Quit
    End If

    If Ping(sComputerName) = False Then
    oSh.Popup UCase(sComputerName) & " is not responding to pings." & vbLf & "Ensure you have typed the name correctly.", 0, "Error", 0 + 48 + 4096
    WScript.Quit
    Else
    ' Make backups of files being edited...
    oFs.CopyFile "\\" & sComputerName & sTargetPath & "helpeeaccept.htm", _
    "\\" & sComputerName & sTargetPath & "helpeeaccept.htm.bak", True

    oFs.CopyFile "\\" & sComputerName & sTargetPath & "Interaction\Server\TakeControlMsgs.htm", _
    "\\" & sComputerName & sTargetPath & "Interaction\Server\TakeControlMsgs.htm.bak", True

    Set oAccessFileBak = oFs.OpenTextFile _
    ("\\" & sComputerName & sTargetPath & "helpeeaccept.htm.bak", ForReading)
    Set oAccessFile = oFs.OpenTextFile _
    ("\\" & sComputerName & sTargetPath & "helpeeaccept.htm", ForWriting, True)

    Set oTakeControlFileBak = oFs.OpenTextFile _
    ("\\" & sComputerName & sTargetPath & "Interaction\Server\TakeControlMsgs.htm.bak", ForReading)
    Set oTakeControlFile = oFs.OpenTextFile _
    ("\\" & sComputerName & sTargetPath & "Interaction\Server\TakeControlMsgs.htm", ForWriting)

    ' Edit the access file to auto accept assistance offers
    i = 0
    While Not oAccessFileBak.AtEndOfStream
    sLine = oAccessFileBak.ReadLine
    If i = 158 Then
    oAccessFile.WriteLine("DoAccept(); // This line was added by an automation script." & vbLf & sLine)
    Else
    oAccessFile.WriteLine(sLine)
    End If
    i = i + 1
    Wend

    ' Edit the take control file to auto accept take control requests.
    i = 0
    While Not oTakeControlFileBak.AtEndOfStream
    sLine = oTakeControlFileBak.ReadLine
    If i = 43 Then
    oTakeControlFile.WriteLine _
    (" ")
    Else
    oTakeControlFile.WriteLine(sLine)
    End If
    i = i + 1
    Wend

    ' oSh.Run "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/unsolicited/unsolicitedrcui.htm", 3, False
    ' WScript.Sleep 2000
    '
    ' oSh.AppActivate "Help and Support Center"
    '
    ' oSh.SendKeys sComputerName
    ' WScript.Sleep 500
    ' oSh.SendKeys "{TAB}{ENTER}"

    End If

    Function Ping(strTarget)

    Set objWMIPinger = GetObject("winmgmts:\\.\root\cimv2")
    Set objWMIPingStatus = objWMIPinger.ExecQuery("Select * from Win32_PingStatus where Address='" & strTarget & "'")

    For Each oPing In objWMIPingStatus
    If IsNull(oPing.StatusCode) Or oPing.StatusCode <> 0 Then
    Ping = False
    Else
    Ping = True
    End If
    Next
    End Function

  2. Doug says:

    Did you complete this script? Please post it if you did.

    Thanks,

    Doug

  3. Lewis says:

    Hi Doug, I’m afraid I didn’t finish it. Though a usable idea, it didn’t warrant the time spending on it to complete the script. Sorry.

  4. Lukas Kucera says:

    Hello, greate article, but, i will be complaing about taking control of clients machine. Especialy in enterprise enviroment, i’ll be aware of it. I will highly recomand to left some user interaction, at least accepting the initial request. If you rip of this functionaly “security guys” can blame you about spying on customers/users. In other hand, there is realy no need to conform of overiding control of targeted machine, especialy when user can in any time cancel the connection by pressing ESC.

  5. Lukas Kucera says:

    Hello,
    U may find useful this article: http://msdn2.microsoft.com/en-us/library/ms811079.aspx
    Compleate description of how to make appliaction that work with Remote Help

  6. Josh Goldberg says:

    Very useful. One more thing, do you know how to send a ctrl-alt-del so I can login to the users machine remotely even if he is not there?

  7. Lewis says:

    Hi Josh, I am not aware of there being any facility to do this for a machine that isn’t currently logged on. Sorry.

  8. Rob Dunn says:

    I’ve been thinking of doing this, so I’ll probably modify Doug’s code and release something in the near term.

    Upon pondering the issue of writing the entires to the file, why not just back up the whole html file and write a known good file to the remote system? Without looking into this in-depth at the moment, I can’t see any reason why not to do that (the files seem small enough), instead of writing a few lines here and there. Unless someone can give me a good reason?

  9. Meg says:

    I got hold of Modified RA files that someone else created. Thanks, now I know how to create my own modified remote assistance files.
    Here are two working scripts that copy modified files to a remote machine and initiates a remote assistance session and then removes those files. http://www.visualbasicscript.com/m_50614/tm.htm

  10. Lewis, your post inspired me to create what I believe is an excellent remote assistance solution that gets about as close to VNC as possible. Have a look:
    http://dgrundel.wordpress.com/2007/10/04/unsolicited-remote-assistance/

    I’m new to this whole blogging thing, so give me a break on the posted code. 😛

  11. Rob Dunn says:

    I’ve taken the code that you and Daniel have put together and made it available as a download here:

    http://www.vbshf.com/vbshf/forum/forums/thread-view.asp?tid=323&start=1&posts=1

    This will allow you to enter a computer name and then connect to a remote computer (pending it is not logged out) and open up a remote assistance connection, allowing you to take control with no user intervention on the remote end.

    Thanks again to both of you for your great work!

    Rob

  12. Lewis says:

    Good stuff this Rob. Thanks for the credit!

  13. Luis Caldeira says:

    Hello, thanks to the OP 🙂

    Josh Goldberg you have already a tool to login when a user is not around. it is called remote desktop.

  14. Mark says:

    Rob, your link is broken. I would love to take a look if you could update the link.

    Thanks

  15. Ryan says:

    Found this post through Google, very useful. I was wondering though if the same thing (no permission dialogs) could be achieved in Windows 7 and if anyone had tried messing with that at any point. Thanks.

  16. Mike Irick says:

    Lewis, you might want to revisit this after the KB2675157 and KB2653956 MSSecurity patches lay into your system. On first blush, it looks like they have modified the remote code execution to the point that this will no longer launch as unsolicited. Laid the patches into my XPSP3 station today, and it effectively killed my unsolicited support. If you come up with a fix, I’d sure appreciate it, as i live and breathe URA in our intranet. Thanks! Mike I.

  17. Lewis says:

    Hi Mike, seems a shame that they’ve killed it after such a long time (it was six years ago I posted this hack) but I have to be honest, the only way they could kill it is by signing the code and refusing to run it if the code signing certificate doesn’t validate.

    Have you checked that the piece of JavaScript added to the HTML file wasn’t removed and tried adding it back in again?

  1. Thu 4th October, 2007

    […] gentleman I worked with sent me a link to an interesting article on Lewis Roberts’ blog about offering remote assistance. The article shows Lewis’ method for tweaking a couple files on the client PC that will […]

Discover more from lewisroberts.com

Subscribe now to keep reading and get access to the full archive.

Continue reading