Introduction
PCBackdrop is a command-line tool to automatically display relevant information about a Workstation or Server on the user's desktop background. Items such as the Host Name, Local IP address, Username, Domain Name and the Operating System currently used on the machine, are all displayed in a neat little bitmap that is positioned in the middle of the user's desktop. This is particularly useful for helpdesk calls where the user can quickly provide the details of their workstation to the helpdesk operator. When placed in the Startup folder of a user's profile, or in a logon script, PCBackdrop simply writes a new desktop bitmap (PCBKDRP.BMP which is around 75 KB in size) to the user's 'My Documents' or 'Personal Folder' and then sets it as the default wallpaper for that session. Each time the user logs on to the Workstation, the information on the bitmap will be updated.
Background
PCBackdrop was made as a result of the need for sys admins to tailor a Windows background to display information about a PC or server. This example only shows a few items that can be shown. There's plenty of more system information that can be displayed, but this code shows the basic structure.
Using the code
The code is very straightforward and a lot of the code has been 'glued together' from other contributors of CodeProject. The code flow works like this:
- The information about the PC and the current user is taken from the standard NETAPI32 calls and placed into a string. This string could contain any information, but I have only included the username, IP address etc.
- The string is then sent and converted into a bitmap and saved into the users 'My Documents' folder. The 'My Documents' location is retrieved from the Registry, so it is not hard coded.
- Once the bitmap is saved, the Registry location of the background wallpaper is set to the new bitmap and the shell is refreshed.
The compiled program can run on startup for each user, and it will display the requested details on the background wallpaper of any Windows NT and above PC.
The code requires that netapi32.lib be included.
Points of Interest
This is a simplistic method to enhance a helpdesk to get the details of a user's PC.