Consulting

Results 1 to 3 of 3

Thread: Need remote control vba help for my classroom

  1. #1

    Need remote control vba help for my classroom

    I and many helpful ?gurus? have spent over 2 years building my Excel program to help me be a more efficient teacher. I know I can get utilities to remotely control my student?s W2K computers but I would like to do it inside of VBA. I already can send files so I could use a utility like Folder Watcher on the students? computers that would trigger my VBNet program to do something but I would rather do it using the peer to peer network (no server or Sql). I?m using office 2002. I need to do things like:
    :
    1 launch teacherlogon.reg so after restart the ?teacher? user is active vs the autologon user called Student,
    2. restart their computers
    3 run a program on their computer,
    4, send a text message (already got help from an Excel Forum user on that ? thank you),
    5. pause their keyboard/mouse,
    6 and if all possible, to click on a students computer name in Excel and a get a picture of their screen.

    I don?t want a full remote control program like VNC, NSS or Radmin because the in-class laptops that I could afford to buy for 32 students are 8 years old, 266Mz with 64MB of memory. They do not have excel on them.

    I realize this is a lot but I bet there are a few of you that have the smarts to figure this out and could help my 5th grade classroom. Thanks

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    2) You can shutdown a remote computer (assuming you are an admin on each PC from the command prompt by typing in shutdown. There are several switches so you can specify the computer name to restart with this. I found this Link which may get you started.

    3) If the vb.net app is loaded on each PC have it just Start the application.

    [vba]
    Start (Path)
    [/vba]

    5) Not sure what you mean? You want to disable the keyboard and mouse?

    6) For getting a screen image, I would have the vb.net app running on each machine.

    Try this code:

    http://www.vb-helper.com/howto_net_g...top_image.html

    [vba]
    ' Return an image of the desktop.
    Private Function DesktopImage() As Bitmap
    ' Get the desktop size in pixels.
    Dim desktop_win As Int32 = GetDesktopWindow()
    Dim desktop_dc As Int32 = GetDC(desktop_win)
    Dim desktop_bounds As Rectangle = Screen.GetBounds(New _
    Point(1, 1))
    Dim desktop_wid As Int32 = desktop_bounds.Width
    Dim desktop_hgt As Int32 = desktop_bounds.Height
    ' Make a Bitmap to hold the image.
    Dim bm As New Bitmap(desktop_wid, desktop_hgt)
    Dim bm_gr As Graphics = Graphics.FromImage(bm)
    Dim bm_hdc As IntPtr = bm_gr.GetHdc
    ' Copy the desktop's image.
    StretchBlt( _
    bm_hdc, 0, 0, desktop_wid, desktop_hgt, _
    desktop_dc, 0, 0, desktop_wid, desktop_hgt, _
    SRCCOPY)
    ' Release the bitmap's and desktop's DCs.
    bm_gr.ReleaseHdc(bm_hdc)
    ReleaseDC(desktop_win, desktop_dc)
    ' Return the result.
    Return bm
    End Function

    [/vba]

    Now, assuming that all PCs have access to a shared folder, just have the image saved every minute or so to that folder and save it as the name of "studentname.bmp". Then from Excel you can either open that image, or load it to an image control etc. Since by knowing the student name you would know the path to the image.

  3. #3
    Thank you for taking such a interest in my classroom. 2. Not sure if I said it right but what I need as a teacher is to be able to have a list of students, let's say in A1 to A32 and in B1 to b32, place a mark in one or several, then click on a button to Shutdown those computers, a button to shut/restart and let excel send a command across the network to do those things without VBnet being involved. 3. another button would laiunch a program with command line arguments sent across the network without VBnet 4 . Some times, students don't listen to me (Ok a lot of the times) so I would like to get their attention by stopping their mouse and keyboards from working then pressing the button, starting them again. 6. I love your idea about capturing the screen - I'm going to use that one. Thanks again scott

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •