🪓BGInfo - 桌面背景信息配置工具

BGInfo - 桌面背景信息配置工具
type
status
date
slug
summary
category
tags
password
icon
notion image
 
notion image
 
BGInfo - 桌面背景信息配置工具 (版权 © 2000-2017 Bryce Cogswell, www.sysinternals.com
简介 BGInfo 是一款实用工具,它能自动在 Windows 计算机的桌面背景上显示重要的系统配置信息,例如计算机名、IP 地址、操作系统版本、服务包版本等。这使得管理员无需通过多个诊断窗口就能快速了解系统概况,尤其在管理多台计算机时非常有用。
核心原理 BGInfo 的工作方式是生成一张包含系统信息的新桌面位图(.BMP),然后将其设置为壁纸并退出。因此,它在显示信息后不会消耗任何系统资源,也不会干扰其他应用程序的运行。
适用系统 支持 Windows XP SP3 及更高版本的 Windows 系统。
安装与使用
  • 安装: 无需特殊安装,直接运行 BGINFO.EXE 即可。
  • 卸载: 删除 BGINFO.EXE 文件,并通过 Windows 的桌面属性对话框重置系统壁纸。
  • 自动化:
    • 可将其放入“启动”文件夹,实现每次启动时更新信息。
    • 使用命令行参数 /timer:0 可在不显示配置对话框的情况下直接更新桌面。
    • /popup/taskbar 选项可将信息显示在弹出窗口或任务栏图标中,而不更改壁纸。
    • 可配合 Windows 任务计划程序定期运行,确保长时间运行的系统信息保持最新。
配置存储
  • 默认配置: 默认情况下,BGInfo 将配置信息按用户存储在注册表 (HKEY_CURRENT_USER\\Software\\Winternals\\BGInfo) 中。
  • 配置文件: 用户也可以将配置信息存储在 .bgi 配置文件中,方便在系统所有用户间共享或在多台计算机间共享。在命令行中指定配置文件名即可使用:BGInfo MyConfig.bgi
主要功能与自定义选项
  1. 字段 (Fields):
      • 选择要在桌面上显示哪些信息及其顺序。
      • 网络相关字段(如网卡、IP、MAC地址)会为每个网卡创建单独条目。
      • 自定义字段 (Custom Fields): 允许用户添加自定义信息,来源可以是:
        • 环境变量
        • 注册表值
        • 文本文件内容
        • DLL 或 EXE 文件的版本信息
        • 文件的时间戳(最后修改日期)
        • VBScript 脚本的输出
        • WMI (Windows Management Instrumentation) 查询结果
  1. 背景 (Background):
      • 选择背景颜色和/或壁纸。
      • 可选择“复制用户壁纸设置”,以使用当前登录用户的壁纸,允许用户个性化桌面同时显示 BGInfo 信息。
  1. 位置 (Position):
      • 选择文本在屏幕上的显示位置。
      • 可限制行数以强制长内容换行。
      • 可根据任务栏位置调整文本位置,避免遮挡。
      • 支持多显示器配置。
  1. 桌面 (Desktops):
      • 选择要更新哪些桌面。默认仅更新用户桌面壁纸。
      • 可启用“控制台用户的登录桌面”选项,在用户登录前的界面显示信息。
      • 可启用“终端服务用户的登录桌面”选项,在终端服务登录界面显示信息(仅对运行终端服务的服务器有用)。
  1. 数据库记录 (Database):
      • 可以将生成的系统信息存储到 .XLS.MDB.TXT 文件或 SQL 数据库(如 MySQL)中,用于收集一台或多台系统历史记录。
      • 即使不修改用户壁纸,也可以配置 BGInfo 更新数据库。
  1. VBScript 支持:
      • 通过 VBScript 文件可以获取任意来源的信息或进行精细的格式化。
      • 使用 Echo 函数输出要在 BGInfo 中显示的每一行内容。
      • 可以使用 Field("字段名") 函数获取 BGInfo 预定义字段的值。
      • 可以从脚本中访问 WMI。
  1. 命令行选项:
      • <path>:指定配置文件。
      • /timer:<秒数>:设置倒计时器超时时间。0 表示无对话框更新。
      • /popup:在弹出窗口显示信息,不更新壁纸。
      • /taskbar:在任务栏状态区放置图标,点击后弹出信息。
      • /silent:发生错误时不显示错误对话框。
      • /all:更改当前登录到系统的所有用户的壁纸(需要管理员权限)。
      • /log:<路径>:将错误写入指定日志文件。
      • /rtf:<路径>:将输出文本写入 RTF 文件。
安全警告 (非常重要)
  • 配置文件保护: 确保 BGInfo 使用的配置文件(.bgi 文件)具有适当的文件权限(对不受信任的用户设为只读或更低)。如果其他用户有权写入配置文件,他们可能添加恶意脚本,这些脚本会在您下次运行 BGInfo 时以您的账户权限运行。
  • VBScript 文件保护: 如果配置中引用了 VBScript 文件,那么这些脚本文件本身也需要得到保护,防止被恶意修改。
  • 注册表配置: 默认配置存储在 HKEY_CURRENT_USER 下,通常由 Windows 的用户权限机制保护。
  • 脚本执行: BGInfo 会运行配置中包含的所有脚本,无论其输出是否最终显示在桌面上。
VNC 问题 BGInfo 与 VNC 结合使用时可能出现壁纸不显示或被重置的问题,文档中提供了相应的注册表修改和配置建议来解决。
总之,BGInfo 是一款强大且灵活的系统信息展示工具,通过简单的配置即可在桌面背景上清晰显示关键系统参数,便于快速识别和管理。正确配置并注意安全设置是有效使用 BGInfo 的关键。
BGInfo - Background Info Configuration Copyright © 2000-2017 Bryce Cogswell www.sysinternals.com
Introduction 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. Because BGInfo simply writes a new desktop bitmap and exits you don't have to worry about it consuming system resources or interfering with other applications. BGInfo works on Windows XP SP3 and higher. Installation and Use BGInfo does not require any special installation. To run it simply execute BGINFO.EXE from a convenient location. To uninstall, delete BGINFO.EXE and reset your system’s wallpaper using Windows’ Desktop Properties dialog. By placing BGInfo in your Startup folder you can ensure that the system information being displayed is up to date each time you boot. Once you've settled on the information to be displayed use the command line option /timer:0 to update the display without showing the dialog box. You can use the /popup or /taskbar options if you prefer to see the information without it updating your system’s wallpaper. You can also use the Windows Scheduler to run BGInfo on a regular basis to ensure long-running systems are kept up to date. By default BGInfo stores configuration information on a per-user basis in the registry (this is called the Default configuration). Alternately you can store it in a configuration file, allowing it to be shared among all users of a system or across multiple systems. Security Warning: Ensure your configuration files are protected using appropriate file permissions. If another user has write access to your configuration file they could add scripts to the file that would automatically run under your account the next time you run BGInfo.
Using BgInfo When you run BGInfo it shows you the appearance and content of its default desktop background. If left untouched it will automatically apply these settings and exit after its 10 second count-down timer expires. Selecting any button or menu item will disable the timer, allowing you to customize the layout and content of the background information. If you want BGInfo to edit or use a configuration stored in a file (instead of the default configuration which is stored in the registry) specify the name of the file on the command line: BGInfo MyConfig.bgi
Appearance Buttons Fields: Selects what information appears on the desktop, and the order in which it is displayed. For networking fields (NIC, IP, MAC, etc.) a separate entry is created for each network card on the system. Press the Add button to add the currently selected fields to the text area. Use the Custom button to add special information you define yourself (see Custom Fields below). Background: Selects the color and/or wallpaper to use for the background. If you select the Copy user’s wallpaper settings option then BGInfo will use whatever information is currently selected by the logged on user. This option allows end users to personalize their desktop while still displaying the BGInfo information. Position: Selects the location on the screen at which to place the text. If some items are very long (for example some network card names) you can use the Limit Lines to item to force them to wrap. The Compensate for Taskbar position checkbox adjusts the position of the text to ensure that it is not covered by the Taskbar. The Multiple Monitor Configuration button allows you to specify how multiple monitors attached to a single console should be handled. Desktops: Selects which desktops are updated when the configuration is applied. By default only the User Desktop wallpaper is changed. Enabling the Logon Desktop for Console users option specifies that the wallpaper should be displayed on the logon desktop that is presented before anyone has logged onto the system. On Windows 95/98/ME systems the same desktop is used for users and the login screen, so this option has no effect. Enabling the Logon Desktop for Terminal Services users option specifies that the wallpaper should be displayed on the Terminal Services login screen. This option is useful only on servers running Terminal Services. Preview: Displays the background as it will appear when applied to your system. Configuration Menu Items These are options that control how the bitmap is produced, where it is located and how to import/export settings. File | Open: Opens a BGInfo configuration file. File | Save As: Saves a copy of the current BGInfo configuration to a new file. Once created, you can have BGInfo use the file later by simply specifying it on the command line, or by using File|Open menu option. File | Reset Default Settings: Removes all configuration information and resets BGInfo to its default (install-time) state. Use this if you can't determine how to undo a change, or if BGInfo becomes confused about the current state of the bitmap. File | Database: Specifies a .XLS, .MDB or .TXT file or a connection string to an SQL database that BGInfo should use to store the information it generates. Use this to collect a history of one or more systems on your network. You must ensure that all systems that access the file have the same version of MDAC and JET database support installed. It is recommended you use at least MDAC 2.5 and JET 4.0. If specifying an XLS file the file must already exist. If you prefer to have BGInfo update the database without modifying the user’s wallpaper you can unselect all desktops in the Desktops dialog; BGInfo will still update the database. BGInfo supports connections to a MySQL + MyODBC database. Use a connection string like: Driver={MySQL ODBC 3.51 Driver};Server=DBSERVER;Database=TEST;Uid=root
Bitmap | 256 Colors: Limits the bitmap to 256 colors. This option produces a smaller bitmap. Bitmap | High Color/True Color: Creates a 16-bit or 24-bit color bitmap. Bitmap | Match Display: Creates a bitmap with color depth matching that of the display. Because the bitmap generated by BGInfo is not updated when a user changes the display's color depth you may see unexpected results (especially dithering of the text and background) with some combinations of bitmap and display depth. Bitmap | Location: Specifies the location to place the output bitmap file. This location must be writeable by the account under which BGInfo is run. On Terminal Services servers the bitmap should be placed in a location that is unique to each user. Edit | Insert Image: Allows you to insert a bitmap image into the output. Because BGInfo's configuration information is stored in the registry and Windows limits the size of registry values you may encounter errors when inserting larger images. On Windows 9x/Me systems the limit is 16K, while on NT/2000/XP systems the limit is 64K. Command Line Options <path> Specifies the name of a configuration file to use for the current session. Changes to the configuration are automatically saved back to the file when OK or Apply is pressed. If this parameter is not present BGInfo uses the default configuration information which is stored in the registry under the current user (“HKEY_CURRENT_USER\Software\Winternals\BGInfo”). /timer:<seconds> Specifies the timeout value for the countdown timer, in seconds. Specifying zero will update the display without displaying the configuration dialog. Specifying 300 seconds or longer disables the timer altogether. /popup Causes BGInfo to create a popup window containing the configured information without updating the desktop. The information is formatted exactly as it would if displayed on the desktop, but resides in a fitted window instead. When using this option the history database is not updated. /taskbar Causes BGInfo to place an icon in the taskbar’s status area without updating the desktop. Clicking the icon causes the configured information to appear in a popup window. When using this option the history database is not updated. /silent Prevents BGInfo from displaying an error dialog if an error occurs. /all Specifies that BGInfo should change the wallpaper for any and all users currently logged in to the system. This option is useful within a Terminal Services environment, or when BGInfo is scheduled to run periodically on a system used by more than one person (see Using a Schedule below). This option requires Administrator privilege on the system. /log:<path> Causes BGInfo to write errors to the specified log file instead of generating a warning dialog box. This is useful for tracking down errors that occur when BGInfo is run under the scheduler. /rtf:<path> Causes BGInfo to write its output text to an RTF file. All formatting information and colors are included. /i<path> [Deprecated] Imports the information in the given configuration file into the Default Configuration. If the file does not exist an error dialog is presented. /iq<path> [Deprecated] Imports the information in the given configuration file into the Default Configuration. No warning is provided if the file does not exist. Custom Fields If BGInfo does not contain information you would like to display you can create a user defined field that contains whatever information you want. You can define one or more custom fields that display: ⦁ An environment variable; ⦁ A registry value; ⦁ The contents of a text file; ⦁ The version information contained in a DLL or executable file; ⦁ The time stamp (last modified date) of a file; ⦁ The output of a VB Script; ⦁ The result of a Windows Management Instrumentation (WMI) query. When you define a custom field the value of the field is evaluated every time BGInfo runs, regardless of whether you are displaying the field on your wallpaper. For example, if you define a field that references a network file, or a script that takes a long time to run, then there will still be a short pause while BGInfo evaluates that field, even if you choose not to display it. WMI provides an easy way to access a wide variety of information available on Windows Me or Windows 2000 and later (WMI is available as a download for earlier versions of Windows). Examples of WMI queries are: Hard Drive Model: SELECT Model FROM Win32_DiskDrive Motherboard Manufacturer: SELECT Manufacturer FROM Win32_BaseBoard Video Adapter: SELECT Name FROM Win32_VideoController
VB Script Support Use a VB Script file when you want to display information drawn from arbitrary sources, or to ensure information is formatted exactly the way you want it. You must create a separate VB Script file for each field you define. Use the Echo function to write the information you want BGInfo to display. Each call to Echo will create a separate line of output. For example, the following VBS will display a list of network drives connected to the system: Set WshNetwork = CreateObject("WScript.Network") Set oDrives = WshNetwork.EnumNetworkDrives For i = 0 to oDrives.Count - 1 Step 2 Echo oDrives.Item(i) & " = " & oDrives.Item(i+1) Next
Use the Field function to retrieve the value of a predefined BGInfo field. For example, the “System Type” field contains a set of comma separated items that describe the features of the system being used (e.g. “Domain Controller, Primary, Terminal Server”), but perhaps you prefer for each of these items to be displayed on its own line. You can write a script that replaces the commas with the vertical tab character, which forces each item to appear on its own line: temp = Field("System Type") temp = Replace( temp, ", ", CHR(11), 1, -1, 1 ) Echo temp
All predefined fields are evaluated before user-defined fields, so it is always safe to reference a predefined field from within your script. However, the order in which user-defined fields are evaluated is arbitrary, so you cannot reliably refer to a user-defined field within a script. Security Warning: Ensure your VB Script files are protected using appropriate file permissions. If another user has write access to your VB Script files they could modify the scripts to perform actions under your account the next time you run BGInfo. Accessing WMI from a script WMI (Windows Management Instrumentation) is a powerful mechanism that allows you to gather and manipulate information about virtually any aspect of your system, including software, hardware, services and BIOS settings. On systems that support WMI you can access WMI objects using VB scripting. For example, to display the BIOS version of a system use: winmgt = "winmgmts:{impersonationLevel=impersonate}!//" Set SNSet = GetObject(winmgt).InstancesOf("Win32_BIOS") for each SN in SNSet Echo SN.Version Next
Using a Schedule BGInfo can be run under the Windows Task Scheduler in order to automatically update a system’s desktop on a periodic basis. Add BGInfo to the scheduler just as you would any other application, along with any command line options desired. Set the Account field to be the name of the user whose desktop should be updated. When set to update the User Desktop BGInfo will update only the wallpaper for the account specified as the “Run as” account in the Task Scheduler. However, if you add the command line option /all and specify an account having Administrator rights then the change will be made to any and all interactive sessions on the system. Finally, you can create a schedule using the Task Scheduler’s special “At System Startup” scheduling option which will update the Console logon wallpaper or Terminal Services logon wallpaper at boot time. Use the Desktops button to specify updating the Logon Desktop for Console users and/or the Logon Desktop for Terminal Services users in this case. Security Issues As with any application that supports scripting you must ensure that the configuration data that BGInfo uses is properly protected from untrusted users. If untrusted users are granted write access to BGInfo’s configuration data they could alter it to run arbitrary applications under your account. Fortunately, it is easy to avoid this possibility. There are three places where security is an issue: ⦁ If reading the Default Configuration (stored in the registry at HKEY_CURRENT_USER\Software\Winternals\BGInfo) then the registry key needs to have read-only permissions (or less) set for untrusted users. Since the registry key is part of HKEY_LOCAL_USER this should be handled by Windows automatically. ⦁ If reading the configuration data from a .BGI file then the file needs to have read-only permissions (or less) set for untrusted users. ⦁ If the configuration data contains a reference to a VB script, then the actual script file needs to have read-only permissions (or less) for untrusted users. In summary, you must protect the configuration data to make sure nobody adds an untrusted script, and then ensure that any scripts you add yourself are protected from being modified. Important: BGInfo runs every script that is included in a configuration, regardless of whether the script output is displayed on the desktop. The list of scripts run by BGInfo is the list provided by the Custom button. VNC Issues Several issues can occur when using BGInfo in conjunction with VNC: ⦁ On connect, VNC does not display the BGInfo wallpaper. By default most configurations of VNC remove any active wallpaper on connect to the host. To fix this add a registry entry to VNC to disable the "remove wallpaper" function: [HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default] "RemoveWallpaper"=dword:00000000 ⦁ On disconnect, VNC resets the wallpaper. When disconnecting VNC resets the active wallpaper to the wallpaper specified under the .DEFAULT user profile. To fix this enable the Logon Desktop for Console users option in the Desktops dialog. This will add the BGInfo wallpaper to the .DEFAULT user profile
上一篇
ServiceNow 管理员基础课程
下一篇
哇!发现一个超强的开源AI修图工具IOPaint,能一键擦除水印、智能补图甚至扩展画面,连苹果应用商店都有同款!想不想知道怎么玩转这些黑科技?详情请点击下方卡片查看👇
Loading...