script to shutdown and startup computer at my school

Posted on 2010-01-03
Last Modified: 2012-05-08

I work at an school and we had before a script that it works but after re-imaging the machines and a few changes in our network our script .bat file stop to work. Please find the code attached.

My question is: until we find out what had happened woud you know a local script i could put in each machine or a script i could run from my machine?

I hope to hear from you soon.

Happy new year.


rem to Shutdown our workstations

\\blackhole\IT\Shutlab\down	\\wclab00	/P /Q

\\blackhole\IT\Shutlab\down	\\wclab01	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab02	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab03	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab04	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab05	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab06	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab07	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab08	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab09	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab10	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab11	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab12	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab13	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab14	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab15	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab16	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab17	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab18	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab19	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab20	/P /Q			

\\blackhole\IT\Shutlab\down	\\wclab21	/P /Q

rem to Start up our workstations

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D2:1E

\\blackhole\IT\Shutlab\winwake 00:16:E6:04:69:B8

\\blackhole\IT\Shutlab\winwake 00:16:E6:04:69:C8

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D2:50

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D2:38

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F0:BC

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D0:E2

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:EE:84

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:AC:E6

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F0:F4

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:56:F2

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:5C:62

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:B1:38

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:E8:8A

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F0:FC

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:EF:46

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:B1:02

\\blackhole\IT\Shutlab\winwake 00:16:E6:70:0C:B2

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F1:B4

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:B0:9C

\\blackhole\IT\Shutlab\winwake 00:16:E6:04:69:8E

\\blackhole\IT\Shutlab\winwake 00:16:41:EC:6E:F1

Open in new window

Question by:emilhomem
    LVL 10

    Expert Comment

    get a new batch file:
    shutdown -r -m \\ -t 00
    above will restart the machine immediately

    Author Comment

    what about the start up. Sorry I could understand why only shutdown line but there is nothing related to start up. Can you clarify please!?
    LVL 10

    Expert Comment

    parameter <-r> will restart the machine.
    LVL 2

    Expert Comment

    I can see you are trying to start the PCs via a wake-on-lan command
    Is Wake-on-lan activated on the PC's ? - check in the system Bios
    Winwake will send a UDP packet (default port 7) - Check this is not blocked by any firewalls.
    You say you have done some network changes , can you ping the PC's from the machine running the script?

    To shutdown you use "Down" command - don't know this but the "Shutdown" command works well but you will need RPC port open (135).
     - try shutdown -f -m \\computername

    Let me know how it goes

    Author Comment

    Wake-on-lan is activated on the PC, yes. I have check the BIOS but I do not have the option to see any (default port 7). Can you tell me how I check if it is blocked by any firewall?

    I have also ping the machines and it is ping as usual, no problem with that.

    the shutdown -r - m \\ -t 00 is working fine. With this command i can restart the machines but not wake them up.

    I also can run the script to shut them all down.

    The only problem still on how to wake them up.

    Would you send me some instruction on how could I check if they are blocked by any firewall?

    One more thing I forgot to tell you. This Lab has 22 machines, 21 are connected with two switches, ten machines in one and 11 machines linked to another switch. Only one machine the number 22 is not connected to the switch but to a spare drop on the wall and this one WAKES UP. Do you thing it could be that those Switches port are blocked by our Network Engineer? I have asked him but I don
    't know if he can check or see that issue on his end.

    Can you let me know what is your opinion on that?


    LVL 2

    Expert Comment

    Sounds like your problem is the switches
    You try to confirm this by connecting a different PC to the spare drop

    What is the make and type of the switches?
    Do you have a configuration for them?
    Since winwake uses MAC addresses it will broadcast to all machines, is there anything in the switch configuration to stop the broadcast?


    Accepted Solution

    I have a colleague on the other branch that have the same problem as i have. We will talk to our Network Engineer again for him to check more thoroughly and try to find out what is the problem.

    Many thanks for your help.

    Author Comment

    Many thanks for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
    Article by: Leon
    Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
    Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
    The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now