December 27th, 2007

A couple of lesser-known Windows-key shortcuts

I’m a die-hard keyboard user, and always like to know when there’s a keyboard shortcut to accomplish something that might otherwise take a few strategic mouse clicks. The Windows key, while a bane to gamers’ existence, actually provides us with some useful functions.

I’ve known about several Windows key shortcuts for years, but there are a couple that I learned about more recently (sometime in 2007, I think), which I now use on a daily basis. The title of this post refers to these as ‘lesser-known’, but I base that purely on the fact that *I* did not know about them, not on any sort of user experience testing or published statistics.

Windows-D: Show Desktop

Hides all open windows, bringing the Windows desktop to the front. This duplicates the functionality of the ‘Show Desktop’ icon that exists in the Quick Launch toolbar by default, and the ‘Show the Desktop’ option in the context menu that appears when you right-click the taskbar. It does not actually minimize the other windows, and those windows can be re-focused via Alt-Tab or by clicking their taskbar entries.

Windows-L: Lock Computer

This duplicates the functionality of the ‘Lock Computer’ button in the Ctrl-Alt-Delete Windows Security dialog. On Windows XP systems that use Fast User Switching, it takes you back to the screen that lists user accounts.

I make it a habit of hitting Windows-L whenever I’m done using my PC at home, so that when my wife sits down to use it, she can just click her name and login (or resume her existing session). At work, it’s always a good idea to lock your computer, so I hit Windows-L whenever I get up to leave my desk.


Now, here are a few more well-known (i.e. I’ve known about them for a long time) ones:Windows-M: Minimize AllThis minimizes all open windows. Programs that hide out in the system tray when you minimize them will be sent to the system tray. Everything else will be minimized to the taskbar. This has the same effect of clicking the ‘Minimize’ icon in the top-right corner of all of your open windows.Windows-F: Search for Files and Folders

This pops up the Windows file search feature. This duplicates the functionality of clicking the Start Menu, clicking the ‘Search’ menu option, and clicking the ‘For Files or Folders…’ sub-menu option.

Windows key (by itself): Open the Start Menu

This pops up the Start Menu, just like what happens when you press Ctrl-Esc or click the start menu. I use this all the time.


Please note that I’ve still never used Windows Vista, so I am unfamiliar with any Windows-key shortcuts which may have been introduced with it. The shortcuts I’ve described, above, are valid in Windows XP Professional (and most of them were usable in previous versions of Windows as well). I did read about a change to the way the Start Menu works, in Vista, with the introduction of a smart search box.

If you know of any useful Windows-key shortcuts that I may have missed, for ANY version of Windows, please leave a reply and let me (and other readers) know!

November 2nd, 2007

Windows Mobile and extended Daylight Savings Time

Ryan Somma recently blogged about software glitches due to the extended Daylight Savings Time that was introduced by the US government’s Energy Policy Act of 2005. One of the issues that he experienced was:

My cell phone has been waking me up an hour early all week because it thinks that Daylight Savings Time (DST) began last weekend. I can’t change the time because it’s managed by Cingular, so it’s the fault of their systems.

My cell phone’s been wrong this week, as well. I know I applied a DST patch back in the spring, but I think I must have installed a new copy of Windows Mobile on my phone since then, and it didn’t include the patch.

At first, I tried setting my phone’s clock manually, but then I experienced the same automatic time setting that Ryan did, care of Cingular. Yesterday, I finally got tired of seeing the wrong time, so I changed my time zone to Atlantic (GMT-4), and then went looking for the Windows Mobile Extended DST patch.

You can find the necessary patch(es) and instructions for Windows Mobile devices here, if you still need them. My phone is back to the Eastern (GMT-5) time zone, now, and is showing the correct time. Hopefully it will adjust properly on Sunday, too.

On a humorous but not directly related to DST note, I accidentally set my alarm clock one hour ahead when attempting to turn it off, earlier this week. Later that day, I was sitting in my room, working on my laptop, and tried to see what time it was. My laptop said one thing (the correct time), and Lacey’s alarm clock showed a similar (+/- 5 minutes) time, but my alarm clock was an hour ahead, and my cell phone was an hour behind. That was rather confusing. :)

October 26th, 2007

The *** service could not be started.

When I tried to start my Apache Tomcat application server’s Windows Service, this morning, I was greeted with a lovely error message:

$ net start tomcat5
The Apache Tomcat service is starting.....
The Apache Tomcat service could not be started.

More help is available by typing NET HELPMSG 3523.

Naturally, I wanted to know more about why it failed, so I typed the command that it suggested. The results were not quite what I’d consider “more help”:

$ NET HELPMSG 3523

The *** service could not be started.

Now, this is the point where I’d usually go into a thoroughly-researched, in-depth explanation of the root cause of the error. But, I didn’t bother investigating it any further, because I noticed shortly afterwards that the service actually DID start–just not immediately.

Looking at my Tomcat application debug log, I saw this:

25-Oct-2007 09:16:48 AM: [INFO] Server startup in 30124 ms

Usually, the numbers are a little smaller:

24-Aug-2007 12:08:08 PM: [INFO] Server startup in 15822 ms
24-Aug-2007 01:51:25 PM: [INFO] Server startup in 16736 ms

So, I’m guessing that the Windows Services controller got impatient, when Tomcat took 30 seconds to start instead of only 16 seconds. If I ever get this error message again, though, you’d better believe I’ll post a follow-up with a full explanation. :)

May 18th, 2007

How to tail files in Windows

I’m a big fan of cygwin, so most of the time I have countless small-but-useful utilities at my disposal, without having to think twice. But, when doing system administration on a client’s server in an off-site data center, I’m very limited in what software I’m allowed to put on the machine. For sysadmin tasks, though, unix utilities are pretty hard to do without.

For instance, one of my favorite tools for watching log files is tail, usually with a -f or -F parameter (”follow” and “follow+retry”, respectively; both let you see new lines as the file(s) grow, the latter keeps trying in case the file doesn’t exist yet). Unfortunately, vanilla Windows installations still don’t come with a tail utility. So, I went searching for other ways of tailing files, besides installing cygwin.

One method that I found can be used without any additional software. It’s just a batch file. It can’t follow changes, but you can at least view the last N lines of a file. Here it is, from a FAQ on Microsoft TechNet, by Jerold Schulman:

@echo off
if {%1}=={} @echo FileName parameter required.&goto :EOF
if not exist %1 @echo %1 does NOT exist.&goto :EOF
setlocal
set file=%1
set /a number=10
if not {%2}=={} set /a number=%2
for /f %%i in ('find /v /c "" ^< %file%') do set /a lines=%%i
@echo %lines% lines in file %file%.
if %number% GEQ %lines% set /a start=0&goto console
set /a start=%lines% - %number%
:console
more /e +%start% %file%
endlocal

I really missed tail -F, though, so I went looking again for some way to tail -F without cygwin. There are plenty of freely available utilities out there that should do the trick, but I wanted to find the simplest, safest one, from a trustworthy source, preferrably open-source so the integrity is verifyable. After looking at a couple open-source options, I stumbled across a page on malektips.com: Windows XP and DOS - Unix Style Tail Command

I learned from that page that you can download the Windows Server 2003 Resource Kit Tools package for free, and that it includes a tail utility (including -f functionality). After downloading and installing that on my laptop, I looked in the installation directory, and found tail.exe there. It’s only 7k!

Next, I FTP’d that to the server I needed to run it on, and gave it a try, hoping that it did not have dependencies that required installing the whole Resource Kit Tools package. As it turns out, it worked liked a charm! It’s nice and small, and arguably from a trustworthy source (Microsoft itself). Easier to justify than most of the other tools I was able to find, in case anyone ever questions my putting it on the server.

December 26th, 2006

I wish Windows Explorer had icon grouping

I want icon groups in windows explorer. I haven’t actually researched this yet, to see if anybody’s made anything that can enable the behavior I’m interested in, but it would be nice if it was just a feature natively in windows.

My desktop always gets too cluttered, but I want things handy, and I like some redundancy between start menu and desktop and quick launch toolbar…

So, on on my desktop, I either have tons of icons all over the place (sometimes with “Auto-Arrange” turned off, with similar icons placed near each other in small groups), or i make folders on desktop and group icons into those folders.

With the former, inevitably, the icon arrangement ends up getting screwed up at one point or another, and I end up with an alphabetically-sorted mess again. With the latter, the folders mean that it takes 2 clicks to get to what I want, and 1 click is already mildly annoying (I’m a keyboard guy).

spugbrap's start menu

[tangent] Actually, being a keyboard guy is the reason that I usually run programs by pressing the Windows key to pop up start menu, and then a letter/number to run one of the programs in my main start menu folder, which I have named such that most programs have a unique first character (see screenshot on the right). It’s not the ultimate in optimization and efficiency, but it works for me. [/tangent]

So, rather than throw my icons into folders and hide them, it would be nice if I could just group them on the desktop (or whatever folder), and even add a label to the group, and then moving one icon would move the whole group, and you could do something to automatically rearrange the whole folder (desktop in my scenario) with each group’s icons spaced close together, and the groups would get evenly spaced away from other groups, etc.

Just something I thought of a couple days ago. I’m sure it’s been thought of before, but it’s not currently available on my machine, so I wanted to make a note of it. If you know of a good way of doing this grouping type stuff, or if you agree that this would be a potentially useful feature, leave a comment!