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

I have a question related to shutdown the system connected to a LAN

Discussion in 'General Programming Chat' started by Rank 360, Oct 3, 2013.

  1. Rank 360

    Rank 360 Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 24, 2012
    Messages:
    1,920
    Likes Received:
    447
    Gender:
    Male
    Location:
    Google
    There are forty (40) system in office, all are connected in the same LAN network with same IP.

    I need C or c++ code to shutdown the system connected via LAN.

    I don't know it is possible or not if possible post the code...
     
  2. 520am

    520am Regular Member

    Joined:
    Feb 28, 2010
    Messages:
    238
    Likes Received:
    188
    Location:
    kvn.
    Hi

    This works with hostnames if you have a Windows environment.
    Use the following command in CMD and write a batch script:
    shutdown -m \\computername

    You will need administrator rights.
     
    • Thanks Thanks x 1
  3. Rank 360

    Rank 360 Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 24, 2012
    Messages:
    1,920
    Likes Received:
    447
    Gender:
    Male
    Location:
    Google

    I accept this buddy, thanks for the reply but there is lot of code available in Command Prompt but there is no code in C or C++ to do this process in a LAN connected systems..

    I searched in Google also there is no proper code in that result also..
     
  4. FJX

    FJX Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 13, 2011
    Messages:
    356
    Likes Received:
    186
    Location:
    0x90
    First, you need to deploy each client to the target pc's. Then place a master application on the server to handle running remote commands. I don't know if it's possible doing this without the consent of the network administrator though, else you have to deploy FUD apps in order to execute remote shell commands.