Click here to Skip to main content
12,955,493 members (58,310 online)
Click here to Skip to main content
Add your own
alternative version


7 bookmarked
Posted 10 Jun 2011

Lan Sleep/Wake Up Tool

, 10 Jun 2011 MIT
Rate this:
Please Sign up or sign in to vote.
A little GUI tool to manage your Windows boxes, waking them up or putting them to sleep.

I write small tools from time to time that I need to manage my personal lab. Since my machines are in their own powered and air conditioned closet, it isn’t very convenient to get up, open the closet, get slammed by the noise, and turn a machine on. And, I don’t want to leave them on all the time if I’m not using them. I’m no Paul Randal (blog|twitter) but I do use between 4000 and 5000 kilowatt hours a month.

Enter Innovation!

So, since I couldn’t find a simple tool to handle this, I wrote one! LabWakeUp is pretty easy to use.

Don’t blink, you might miss it.

It looks for a text file called servers.txt. This file should have one server name per line. The program loops through them and tries to get a MAC address via a system call (a.k.a. P/Invoke) to the Windows DLL that handles ARP calls. It then writes these to another text file called serverMACs.txt that has, you guessed it, a server name and a MAC address if one could be found. You can manually put entries in this file if you like. I personally don’t like hunting around for MAC addresses then typing them into anything if I don’t have to. You only need to fill in the Windows user name and password if you want to wake a machine up.

They are Undocumented Features!

When you start it up, nothing is displayed while it goes through the servers.txt file. Again, lazy strikes, I may fix it later - it is just annoying and not a “bug”. In serverMACs.txt, if a server isn’t found, it may be a bogus MAC address. This is most defiantly a bug and will be addressed. The serverMACs.txt isn’t updated if a new MAC is found. You have to delete the entry and let it rediscover it.

Improvements are Coming… Eventually!

  • Asynchronous multi-threaded MAC discovery. This will grey out a portion of the tool but will make things more tolerable.
  • Discover MAC on new entries only. So, if there aren’t any new names in servers.txt, we won’t do the MAC lookup.
  • Update MAC entries. Yep, just update the MAC entries that we know about.


If you end up using this tool, let me know! I’d like to think that some of the things I build are useful to others too.


This article, along with any associated source code and files, is licensed under The MIT License


About the Author

Chief Technology Officer SQLWatchmen Inc
United States United States
I’m Wes Brown, currently serving as CTO at SQLWatchmen and as happy as I’ve ever been in my professional career.
Over the past decade or so I’ve been focused on enterprise systems and SQL Server in particular.

That isn’t to say that’s all I’ve ever done just the thing that has brought me to this point in my professional career.

You may also be interested in...

Comments and Discussions

QuestionNo download link? Pin
masterducky12-Oct-13 20:01
membermasterducky12-Oct-13 20:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 10 Jun 2011
Article Copyright 2011 by SQLServerIO
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid