• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

script to shutdown and startup computer at my school


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

  • 4
  • 2
  • 2
1 Solution
get a new batch file:
shutdown -r -m \\computer.name -t 00
above will restart the machine immediately
emilhomemAuthor Commented:
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!?
parameter <-r> will restart the machine.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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
emilhomemAuthor Commented:
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 \\machine.name -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?


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?

emilhomemAuthor Commented:
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.
emilhomemAuthor Commented:
Many thanks for your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now