43

I do a lot of work on Windows Server 2008 remote desktops and often lose track of which host I am currently logged on to.

Is there a way of displaying (without installing any non-standard apps) the host name or IP address of the host I am connected to in either the wallpaper or the notification area?

I tried creating files in the desktop with the name of the machine - but my roaming profile shows the same set of desktop files on every machine, so that was scuppered. Duh!

In shell windows this is easy: just set the prompt to display the host name. Surely there is a simple way of doing the same for the graphical desktop.

SgtOJ
  • 7,397
Martin
  • 565

7 Answers7

47

You are looking for Microsoft's Sysinternals BgInfo. It is very customizable. Not to mention it comes straight from Microsoft for free.

How many times have you walked up to a system in your office and needed to click through several diagnostic windows to remind yourself of important aspects of its configuration, such as its name, IP address, or operating system version? If you manage multiple computers you probably need BGInfo. It automatically displays relevant information about a Windows computer on the desktop's background, such as the computer name, IP address, service pack version, and more. You can edit any field as well as the font and background colors, and can place it in your startup folder so that it runs every boot, or even configure it to display as the background for the logon screen.

Screenshot of BgInfo

Gareth
  • 19,080
SgtOJ
  • 7,397
33

This questions is now 8 years old. BGInfo doesn't seem to work with Windows 10 desktop backgrounds. That is, background images behind the text that BGInfo should be writing on top of. It does work entirely correctly on top of a solid color background as far as I could tell. Pete's registry key didn't work (able to change permissions, had no effect), and I'm not trying that sketchy URL.

So here's a nice simple solution that takes literally 5 seconds to setup:

Right-click on Taskbar -> Go to Toolbars -> Choose New Toolbar, type in \\%computername%, and Click Select Folder. Done.

Credit where credit is due.

6

Find key HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}

I usually rename to OLD.LocalizedString and create a new string but some people simply modify the value... it's up to you.

Edit it reads:

Name = LocalizedString Type = REG_EXPAND_SZ Data = %COMPUTERNAME%

You can also display user name data value = %USERNAME% on %COMPUTERNAME%

It's valuable in disk imaging as when you deploy and give the computer name you'll always have it. You may need to change permissions on the key. Right click on the key and select permissions.

Pete
  • 61
4

Or, requiring no external tools; Make a bat file, placed in a startup folder with content such as;

echo %COMPUTERNAME% > "c:\users\Public\desktop\%COMPUTERNAME% - is this machine"
reben
  • 290
4

Put BGINFO on a network share and add it to a local logon script or a batch file to the startup folder for all users.

There is a switch to supporess the license warning at first run and you can create an optional configuration file that determines what parameters are displayed.

e.g. BGINFO.BAT

@echo off
bginfo bginfo.bgi /TIMER:0 /SILENT /NOLICPROMPT /LOG:Q:\bginfo\log.txt

There is even an option to have it add the computer information to an excel spreadsheet. I have used that in the past to gather configuration information on the workstations

Nifle
  • 34,998
Mike Row
  • 151
3

While BgInfo is free and easy to use (and works fine with modern versions of Windows 11), it doesn't respond to resolution changes, which makes it difficult to use for my use case, connecting to several Windows machines via Remote Desktop. I also use Auto Dark Mode to switch between light and dark themes at sunrise and sunset, and background changes there will discard BgInfo's imprint.

After doing a bit of digging, I found Rainmeter. Rainmeter will put "skins" on the desktop that show various meters, including the system hostname. It can handle translucency, and can be configured to snap the skin to the upper-right corner of the screen.

I created the following skin, starting with the blank template supplied by Rainmeter:

[Rainmeter]
Update=-1
AccurateText=1
DynamicWindowSize=1
DefaultAnchorX=0R
DefaultWindowX=0R
DefaultWindowY=0

[Metadata] Name=Hostname Author=Mattie Behrens Information=Displays the hostname of your computer Version=1.0 License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[MeasureHostname] Measure=SysInfo SysInfoType=COMPUTER_NAME

[MeterString] Meter=String MeasureName=MeasureHostName Text=%1 SolidColor=63,63,63,127 FontColor=255,255,255,255 AntiAlias=1 StringStyle=Bold Padding=16,16,16,16

To run Rainmeter at startup, I added a shortcut to my Startup folder. To do this, I first opened the folder at %AppData%\Microsoft\Windows\Start Menu\Programs\Startup. I then right-clicked Rainmeter on the Start menu and selected "Open file location", and finally copied the "Rainmeter" shortcut into my Startup folder.

Now Rainmeter launches shortly after I log in, and shows the hostname of the machine I'm on. Because Rainmeter saves skins in directories normally shared by OneDrive, the skin is already available on other Windows machines.

Mattie B
  • 391
  • 3
  • 11
0

Or simply get image you want, make a copy of it, set copy as background, correct paths and run(in powershell);

Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms
$imagePath = "C:\TestBkg\LakeTest.jpg"
$text = "$env:username on $env:computername"
$image = [System.Drawing.Image]::FromFile($imagePath)
$screen = [System.Windows.Forms.Screen]::PrimaryScreen
$percentageFromTop = 14
$percentageFromLeft = 26
$positionX = [math]::Round($screen.Bounds.Width * ($percentageFromLeft / 100))
$positionY = [math]::Round($screen.Bounds.Height * ($percentageFromTop / 100))
$graphic = [System.Drawing.Graphics]::FromImage($image)
$font = New-Object System.Drawing.Font("Arial", 26)
$brush = New-Object System.Drawing.SolidBrush([System.Drawing.Color]::Yellow)
$position = New-Object System.Drawing.PointF($positionX, $positionY)
$graphic.DrawString($text, $font, $brush, $position)
$image.Save("C:\TestBkg\LakeTest2.jpg")
$font.Dispose()
$brush.Dispose()
$graphic.Dispose()
$image.Dispose()
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 0, False
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True
exit

It will take image, add text to it, save it as "new file"* ,then it will refresh settings(refresh image). Powershell has to close or it might bug out and not refresh the image change.

*-must be newfile, System.Drawing locks original image

Danijel
  • 461