Make bginfo a standard part of your Windows server deployments

by Ed Fisher on 2007-06-13

in Architecture

If you are like most Windows admin’s, you find yourself accessing the console of various servers throughout the day. If you are using an rdp client like mstsc, or rdesktop, you may have several remote sessions open at the same time. And unless you just went through a major hardware refresh, you probably have a variety of different hardware platforms in production. If you are running multi-homed servers, or servers that for some reason cannot reliably resolve all required names through DNS, you probably have static route entries, and either a HOSTS file, an LMHOSTS file, or both, in use on your system. If you are like me, it gets kind of confusing trying to keep track of each system that you are on, and you might have wasted some time trying to troubleshoot a connectivity problem before realising that there was a static route, or an out of date ip.addr in the local file. Over time, I have come to make bginfo a standard part of every Windows server I stand up, and if I have to spend more than five minutes on someone else’s server and expect that I’ll have to come back later, odds are I will add it to that server too.

This tool was developed by the geniuses at Sysinternals, and though they are now a part of Microsoft, is still one of the free tools available here. When run, this tool will take whatever wallpaper you have, and overlay text information such as the system hostname, ip.addr information, cpu, ram, free disk space, or free form text. You can control the font, size, and colour of the information, and the placement on the desktop, and when you update, you can update the active desktop, terminal sessions, and even the wallpaper before login.

Here is a screenshot from one of my servers.

It is an ISA server, so there are both static routes, and the use of a HOSTS file. You can see that I feature that information prominently at the top of the page, along with the following standard information: hostname, boot time, ip.addr’s, cpu, ram, and free disk space.

As part of any server build, I use the following four files.
bginfo.exe-see the download link above
bginfo.cmd-a simple batch file to run at each login. You can also schedule it if you want more frequent updates without logging in. Here’s the contents of that file.
—start—
bginfo.exe c:\windows\config.bgi /timer:0
—-end—-
config.bgi
This is a binary file, so I cannot paste it here. The first time you run bginfo.exe, customise the basics as you want them, and save that as the default. This will create a %windir%\config.bgi file that you can copy to other hosts. The first time you run it, you will see all the available default fields. You can also define custom fields, or even insert images like the corporate logo if you want to.
bginfo.reg
This registry key can be imported into your registry, and sets up the RUN key so that the bginfo.cmd executes at each login. Here’s the contents of that file.
—start—

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"bginfo"="c:\\windows\\bginfo.cmd"


—-end—-

Copy the first three to %windir%, and just double-click the reg file to import it into your registry. Now, each time someone logs onto the server, the cmd file will run and update the information on the wallpaper. You can of course manually run it from the cmd line or start, run. You will probably want to play around with the colours of the text and background, as well as the fields that are displayed, until you find the right mix for you and any other admins on your team who will have to deal with your servers. Once you do, you will find this to be a great addition to your standard deployment, and find yourself wondering how you lived without it.

More information is available from Microsoft’s website at http://www.microsoft.com/technet/sysinternals/Miscellaneous/BgInfo.mspx.

You might also enjoy:

  1. Eleven programs that should be a part of every Windows server build
  2. howto://make Windows 7 file transfers fly
  3. howto://Installing MS Project Server 2007 on Windows 2008
  4. howto://troubleshoot microsoft vpn connections part one-server side issues

{ 11 comments… read them below or add one }

David 2011-03-17 at 13:17

Hi,
Do you know if you could just point this to a network share rather than run locally?
If so, that would probably make more sense.

Cheers,
D

Reply

Ed Fisher 2011-03-17 at 20:59

Hi David,
Yes, if everything you wanted it to display was either the same for all systems, or just handled by variables. That would work just fine.
Ed

Reply

Steve 2011-09-08 at 15:54

For some reason, the registry key doesn’t show up in the registry under [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] after I double-click on the reg file. The contents of the reg file are exactly the same as what you have above. I also receive confirmation that, “the keys and values contained in bginfo.reg have been successfully added to the registry.” Any ideas?

Thanks,
Steve

Reply

Ed Fisher 2011-09-08 at 15:59

Steve,
Try again, using the text below. It looks like the post is showing “smart quotes” instead of ascii quotes, and that might be tripping you up. I will try to edit that post shortly.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"bginfo"="c:\\windows\\bginfo.cmd"

HTH
Ed

Reply

Steve 2011-09-08 at 16:03

Thanks Ed. Still no luck, however. This is driving me crazy. It’s probably something so simple that I overlooked but I can’t figure it out.

Reply

Ed Fisher 2011-09-08 at 16:10

What operating system, is it 64bit, and do you have admin rights?

Reply

Steve 2011-09-08 at 16:12

It’s Windows 7 32-bit and yes, I’m logged on as the administrator.

Reply

Steve 2011-09-08 at 16:15

I also tried this on a Windows Server 2008 R2 64-bit box to no avail.

Reply

Ed Fisher 2011-09-08 at 16:31

Hmm, just tried on both here (32 Win7Ultimate, and 2008 R2) and it worked a charm on both boxes. Do you have non-standard perms being set on that registry key maybe?
The perms I show, which should be default, are
CREATOR OWNER inherited special, which is just to subkeys
SYSTEM inherited full control and read
Administrators (of the local machine) inherited full control and read
Users (of the local machine) inherited read
If your perms look good, maybe your anti-X is locking you out of or reverting changes to the reg key since malware used to like dropping stuff in that key.
Ed

Reply

Ed Fisher 2011-09-08 at 16:57

To close the loop on this, I emailed Steve a file. The one he was using had a blank line in it between the first two lines, and interestingly enough, prompted him that the import was successful even when it wasn’t. I saw the same behaviour when I added a blank line, so there you go, no blank lines in reg files, and another happy customer good to go.

Reply

Steve 2011-09-08 at 17:02

Thanks again for your help on this, Ed! Your lightning-fast responses are much appreciated :)

Reply

Leave a Comment

Previous post:

Next post: