1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sending commands via VB

Discussion in 'Scripting & Programming' started by philbenson, Jul 11, 2006.

  1. philbenson

    philbenson Byte Poster

    I am developing a Win App in VB Net 2005 to send ping commands to various computers on my network and thereby check to see whether various PCs are switched on or not. This can be done by using the My.Computer.Network.Ping function.

    I now want to be able to send various commands to PCs on the network in order to, for example, shut them down, send a message or run a remote desktop session. My idea is to attach a context menu to the icons representing the PCs so that the commands will be sent to a particular IP address. Can this be done?
    Certifications: MCP, MCP+I, MCSE, MCSA, MCTS
    WIP: CCNA(?)
  2. Phil
    Honorary Member

    Phil Gigabyte Poster

    yup it certainly can be done, I've done something very similar in the past using a web interface which gave all sorts of information including whether the machine was up, who was logged in and IP details. it used Wake on Lan to fire up a PC if it was down, enabled you to log a user out and remote control a PC using the SMS remote control script.
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  3. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    A quick search came up with
    Shell ("batchfile.bat")
    where batchfile does the deed.

    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  4. philbenson

    philbenson Byte Poster

    Great, thanks - so by using the shell function I can send a single command, or series of commands via a batch file. One problem solved.

    Next hurdle to get over is how I can get the icons representing different computers to send the commands to the computer they represent.

    I have created a context menu which currently contains three menuitem objects. So now I need the command I send in the Shell command to relate to different PCs, depending on which icon I right click on. (attachment of current form layout attached).

    Attached Files:

    Certifications: MCP, MCP+I, MCSE, MCSA, MCTS
    WIP: CCNA(?)

Share This Page