Arduino Mega with ethernet shield to control 45 relay from http and command Line

hi, I'm new and I hope that this question has not already been done, I tried to do some research but have not found anything.
I just started learning about Arduino and I need to control about 45 relays, I have the mega version with an Ethernet shield.
I would like to know if there are sktech involving the operation of arduino either web or from the command prompt, I found many tutorials that allow me to activate a relay via http, but none that do it via command prompt.
in practice I have to check the relays with Arduino connected only with lan and I need to be able to do via command prompt.
I think that it is not a complex thing, but I do not know where to start, I apologize if the topic has already been discussed and I apologize for my bad English

I would like to know if there are sktech involving the operation of arduino either web or from the command prompt,

Plenty of web examples. You can't control the Arduino from the command prompt, unless the command you type starts a program that writes to the serial port.

in practice I have to check the relays with Arduino connected only with lan

If the Arduino is not connected to the machine that the command is running on, you can't control it from the command prompt.

I think that it is not a complex thing

Then, you should be done by now. Of course it's a complex thing.

thanks for the answer
ok, clearly I meant that it should not be a difficult thing for anyone who is not a beginner like me.

Anyway thank you for giving cleared things up with regard to control ethernet via command line.

I should have to interface arduino with other software, it is possible to control arduino ethernet via a simple link (such as a dektop shortcut for an example)

in summary I would comand arduino ethernet without using the browser but using commands directly, so that I can send it from my software

thanks for your attention

There is nothing magical about a browser. It makes GET requests, and renders the response in some (except in IE's case) intelligent format. You need to write an application to do the same thing.

45 rerlays and the ethernet shield your going to run out of pins...

in summary I would comand arduino ethernet without using the browser but using commands directly, so that I can send it from my software

Most any application that doesn't open/close the com port when sending commands probably could be used. Applications like batch files can be used if the arduino auto reset is defeated.

ok i found one way...
i use a scketch found at http://bildr.org/2011/06/arduino-ethernet-pin-control/ that activate a pin by a url
for use the command line i use wget and the address, and this works perfect for me
but can i use all the pins of arduino mega or only 13 pins of the ethernet shield?

and i don't know how to modify this sketch to let me turn off a pin, can anyone give me a hand?

//ARDUINO 1.0+ ONLY
//ARDUINO 1.0+ ONLY


#include <Ethernet.h>
#include <SPI.h>
boolean reading = false;

////////////////////////////////////////////////////////////////////////
//CONFIGURE
////////////////////////////////////////////////////////////////////////
  //byte ip[] = { 192, 168, 0, 199 };   //Manual setup only
  //byte gateway[] = { 192, 168, 0, 1 }; //Manual setup only
  //byte subnet[] = { 255, 255, 255, 0 }; //Manual setup only

  // if need to change the MAC address (Very Rare)
  byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

  EthernetServer server = EthernetServer(80); //port 80
////////////////////////////////////////////////////////////////////////

void setup(){
  Serial.begin(9600);

  //Pins 10,11,12 & 13 are used by the ethernet shield

  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);

  Ethernet.begin(mac);
  //Ethernet.begin(mac, ip, gateway, subnet); //for manual setup

  server.begin();
  Serial.println(Ethernet.localIP());

}

void loop(){

  // listen for incoming clients, and process qequest.
  checkForClient();

}

void checkForClient(){

  EthernetClient client = server.available();

  if (client) {

    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    boolean sentHeader = false;

    while (client.connected()) {
      if (client.available()) {

        if(!sentHeader){
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          sentHeader = true;
        }

        char c = client.read();

        if(reading && c == ' ') reading = false;
        if(c == '?') reading = true; //found the ?, begin reading the info

        if(reading){
          Serial.print(c);

           switch (c) {
            case '2':
              //add code here to trigger on 2
              triggerPin(2, client);
              break;
            case '3':
            //add code here to trigger on 3
              triggerPin(3, client);
              break;
            case '4':
            //add code here to trigger on 4
              triggerPin(4, client);
              break;
            case '5':
            //add code here to trigger on 5
              triggerPin(5, client);
              break;
            case '6':
            //add code here to trigger on 6
              triggerPin(6, client);
              break;
            case '7':
            //add code here to trigger on 7
              triggerPin(7, client);
              break;
            case '8':
            //add code here to trigger on 8
              triggerPin(8, client);
              break;
            case '9':
            //add code here to trigger on 9
              triggerPin(9, client);
              break;
          }

        }

        if (c == '\n' && currentLineIsBlank)  break;

        if (c == '\n') {
          currentLineIsBlank = true;
        }else if (c != '\r') {
          currentLineIsBlank = false;
        }

      }
    }

    delay(1); // give the web browser time to receive the data
    client.stop(); // close the connection:

  } 

}

void triggerPin(int pin, EthernetClient client){
//blink a pin - Client needed just for HTML output purposes.  
  client.print("Turning on pin ");
  client.println(pin);
  client.print("
");

  digitalWrite(pin, HIGH);

}

but can i use all the pins of arduino mega or only 13 pins of the ethernet shield?

All of the Mega pins can be used, except those that are already in use.