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

Networks Batch scripting!?!? telnet q's....

Discussion in 'Hardware' started by Answerth, 6 Sep 2006.

  1. Answerth

    Answerth What's a Dremel?

    Joined:
    3 Sep 2006
    Posts:
    8
    Likes Received:
    0
    :hehe:

    ok well anyway i was talking to someone about batch scripting and thought it sounded interesting and was wondering if it was worth looking into and learning about, for an experiment i was wondering if i could make a batch script to execute a series of commands in command promt that included telneting *the computers name* in command prompt and filling in the username and password prompt which i know the answers to, that allowing access to view the processes the computer is running etc, and then typing shutdown -s which will (yes you guessed it!) shut down the computer, and have it do this to all the computers in the network, reason i wanted to do this is i thought it would be a learning experience and i am the network assistant at school and i wanted to be able to shut all 180 computers down without having to walk around to all of them, or is there and easier/better/faster way to access multiple computers through a network at once and control them??
    ____________________________________________________________
    I've been trying to install mac os x tiger on a pc and it really hasnt been working out
     
  2. thingamajig

    thingamajig What's a Dremel?

    Joined:
    29 Nov 2005
    Posts:
    32
    Likes Received:
    0
    Good Luck with that one. If you figure it out through batch you better post it. That being said I'm 99% sure that it's impossible with just Batch. As an alternative I would look into using psexec, which is available from sysinternals.com, which allows you to connect remotely and execute a command or series of commands.

    Again sysinternals.com is your friend here, this time the app is called pslist. I would recommend the entire ps-suite for any admin.

     
  3. planki

    planki ...

    Joined:
    20 Dec 2003
    Posts:
    1,132
    Likes Received:
    0
    it's certainly possible allthough i imagine a large amount of error checking and for and if loops would need to be implemented into the batch file to get it to work properly. For example it might throw up some unexpected errors if the computer is allready turned off and it can't connect etc.

    I think the main problem with this idea is the amount of time that it will take for the batch file to run as i envisage each loop (i.e. each computer) taking 3-4 seconds over the network to process times by 180 = 12 minutes!!
     
  4. coorz

    coorz Miffed

    Joined:
    25 Apr 2003
    Posts:
    1,382
    Likes Received:
    2
    Toss the shutdown script in scheduler.
    This site has some nice VB scripts, mostly useful in an AD network.
     
  5. Answerth

    Answerth What's a Dremel?

    Joined:
    3 Sep 2006
    Posts:
    8
    Likes Received:
    0
    Thank you everyone for your great tips, but i had a question on psexec, because i am looking to preform a series of automated commands and im not sure if it will allow me to. This is why i thought a batch script would work but i guess it cannot be used just to print commands in command prompt, i just need to aquire a connection to numerous computers at once, as if i could telnet 20 computers at once so i can execute the same command on multiple computers, but since it seems i cant, and i do not have access to the networks mainframe, i need to do the same things to a whole bunch of computers one at a time very quickly and do the command and it would be most efficient to automate it, do you know is psexec will let me? and if not do you have any suggestions?
     
  6. Buzzons

    Buzzons Minimodder

    Joined:
    21 Jul 2005
    Posts:
    3,002
    Likes Received:
    29
    psshoutdown as well for turnign it off :p
     
Tags:

Share This Page