Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > BgInfo
  New Posts New Posts RSS Feed - Can we get a new BGInfo for Windows 7?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can we get a new BGInfo for Windows 7?

 Post Reply Post Reply Page  123 5>
Author
Message
 Rating: Topic Rating: 1 Votes, Average 5.00  Topic Search Topic Search  Topic Options Topic Options
hauerwas View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2007
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote hauerwas Quote  Post ReplyReply Direct Link To This Post Topic: Can we get a new BGInfo for Windows 7?
    Posted: 18 September 2009 at 7:08pm
Folks,
 
I'm currently using BGInfo under Windows XP to display info on the logged-out screen on Windows XP.  As mentioned in some other threads, Windows 7 will support login window customization:
 
 
but unfortunately the customized screen has to be JPG, not BMP.  It was also mentioned in other BGInfo threads that Win2K8 R2 is being seen "as" Windows 7, not as Win2K8:
 
 
So:  can we get a new version of BGInfo that would satisfy both?  How do we go about requesting it?
 
Adam Hauerwas
Adam Hauerwas
hauerwas@providence.edu
Back to Top
n8felton View Drop Down
Newbie
Newbie
Avatar

Joined: 14 October 2009
Location: Rochester, NY
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote n8felton Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2009 at 3:36am
+1
Back to Top
sconstantine View Drop Down
Newbie
Newbie
Avatar

Joined: 01 November 2009
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote sconstantine Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2009 at 4:29pm
I second the inquiry!

Thanks~
Back to Top
baer View Drop Down
Newbie
Newbie
Avatar

Joined: 13 November 2009
Location: Germany
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote baer Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2009 at 1:11pm
me too

Clap
Back to Top
andublin View Drop Down
Newbie
Newbie


Joined: 01 December 2006
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote andublin Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2009 at 9:38am

Adding a voice to the request . . .

Back to Top
magbe08 View Drop Down
Newbie
Newbie
Avatar

Joined: 17 November 2009
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote magbe08 Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2009 at 12:00pm
Easy solution would be to add JPG-saving capabilities to BGinfo. Then you'd just set BGinfo to save output to 'backgroundDefault.jpg'.

Of course, it would be nice (although probably difficult) to add a jpeg-saving feature that would optimize output so that we'd having a minimum of compression artifacts around the text output.


Back to Top
thomaskrieger View Drop Down
Newbie
Newbie


Joined: 15 November 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote thomaskrieger Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2009 at 8:40am

yeah

......and plz a native ps1 script file as Replace identifier! ;)
 
thx!
Back to Top
hauerwas View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2007
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (2) Thanks(2)   Quote hauerwas Quote  Post ReplyReply Direct Link To This Post Posted: 19 March 2010 at 4:07pm

Folks,

I have been working on a scripted solution to the problem of Win7 backgrounds and BGINFO.  I've experimented using a free command-line graphics converter to change the bitmap to a JPEG after BGINFO does its work.  If you want to use my approach, the code is available for download from http://dl.dropbox.com/u/13326617/pcinfo.zip or the main scripts are in this posting.

The main script, pcinfo.cmd, gets stored in a directory C:\PC\scripts\pcinfo\.  (The "PC" is because I work at Providence College, and it writes an "info" screen for the login background; it's in a subdirectory off of PC because I also use the directory tree for other purposes.)  Dependent binaries are stored in a pcinfo\bin subdirectory; this includes BGINFO.EXE itself as well as the LEADTools Command Line Image File Converter (called LFC.EXE, available from http://www.leadtools.com/utilities/):

C:\PC\scripts\PCINFO
|   bginfo-7.bgi
|   bginfo-xp.bgi
|   pcinfo.cmd
|   pcinfo.vbs
|
+---bin
|       Bginfo.exe
|       LFC.exe
|       (+59 DLL's for LFC)
|
\---output
        backgroundDefault.bmp
        backgroundDefault.jpg

The pcinfo.cmd script needs to be run once with Administrative privileges in order to create an output subdirectory, set permissions on directories and load registry keys; afterwords, it can be run by non-administrators.  The code detects whether it is running under Win7/2008 or not, which is why there are two .bgi files in the main directory; you can run this under any Windows NT-based platform and it will choose the appropriate file (though sorry, no backgrounds for Vista; this is because Vista encodes the image into a DLL, and I'm hesitant to script modifications to it [refer to http://forum.sysinternals.com/topic14184.html for more info]).

The two .bgi files are configured to write output to C:\PC\pcinfo\output\backgroundDefault.bmp (adopting the naming convention for Win7 backgrounds).  Under Win7, the script will then use LFC to convert the bitmap to a JPEG.  If the file size is larger than 256K it will reconvert the file with the lowest quality to (hopefully) get the file size below 256K.  (Note that if the file is still too large, you likely need to reduce the content of your .bgi files.)

Both .bgi files reference a custom field _pcinfo; this custom field points to a VBScript file C:\PC\pcinfo\pcinfo.vbs.  The VBscript is used to do string parsing and alignment, and also pair MAC to NIC descriptions in a "table" (instead of scrolling MAC addresses down).

To adopt this code, you would need to do the following:

1) Download the zip archive and decompress it to C:\PC\scripts\pcinfo;
2) Copy BGINFO.EXE into the pcinfo\bin directory;
3) Download and install the Command Line Image File Converter from LEADTools (installs to C:\LEADCMD);
4) Copy C:\LEADCMD\LFC.EXE and the C:\LEADCMD\BIN\*.DLL files to the pcinfo\BIN directory.

If you decide to change the paths, the help in the script (pcinfo.cmd /?) will tell you what needs to be changed; basically you need to modify the .bgi files to specify a) the output directory for the bitmap to be a new .\output location, and b) change the _pcinfo custom field to point to the correct location for the VBScript.

I hope you find this useful!

Adam Hauerwas
hauerwas@providence.edu

 
PCINFO.CMD:

@echo off
setlocal enableextensions
echo - %* | findstr /i /c:"/?" > NUL: && goto :help
echo - %* | findstr /i /c:"/v" > NUL: && goto :version
echo - %* | findstr /i /c:"/d" > NUL: && echo on
if exist "%~dp0\bin" path "%~dp0\bin";%path%
mkdir "%~dp0\output" 2> NUL:
ver | findstr /c:"Version 6.1" > NUL: || goto :pre7
:pc
::
:: The following is logic specific to Providence College. Its purpose
:: is to switch between BGINFO templates based on a PCINFO value
:: (read from a script PCVAR).  You can safely delete the section
:: within the :pc and :/pc labels.
::
call pcvar pcinfo || goto :/pc
echo %computername% | findstr /i /b "ZZ" > NUL: && set "_pcinfo=TEMPLATE"
set "_bgifile=%~dp0\bginfo-%_pcinfo%.bgi"
:/pc
:win7
if not exist "%_bgifile%" set "_bgifile=%~dp0\bginfo-7.bgi"
icacls "%~dp0\output" /grant everyone:(OI)(CI)(F) /t
bginfo /nolicprompt "%_bgifile%" /timer:0
::
:: Note: as of this writing, LFC will fail when a path is surrounded
:: by quotes and ends in a backslash.
::
lfc "%~dp0\output" "%~dp0\output" /b24 /f10 /q2 /noui
for %%i in ("%~dp0\output\backgroundDefault.jpg") do if %%~zi GEQ 256000 lfc "%~dp0\output" "%~dp0\output" /b2 /f10 /q2 /noui
mkdir "%windir%\system32\oobe\info\backgrounds" 2> NUL:
icacls "%windir%\system32\oobe\info" /grant everyone:(OI)(CI)(F) /t
copy /v /y "%~dp0\output\backgroundDefault.jpg" "%windir%\system32\oobe\info\backgrounds\"
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background /v OEMBackground /t REG_DWORD /d 1 /f
%SystemRoot%\System32\rundll32.exe user32.dll, UpdatePerUserSystemParameters
@goto :eof
:pre7
ver | findstr /c:"Version 6.0" && goto :vista
cacls "%~dp0\output" /t /e /g everyone:F
bginfo /nolicprompt "%~dp0\bginfo-xp.bgi" /timer:0
reg add "HKU\.DEFAULT\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "%~dp0\output\backgroundDefault.bmp" /f
%SystemRoot%\System32\rundll32.exe user32.dll, UpdatePerUserSystemParameters
@goto :eof
:vista
@echo off
echo PCINFO is not supported on Windows Vista due to the way the login screen is
echo encoded in a DLL.  For more information, see:
echo.
echo http://forum.sysinternals.com/topic14184.html
echo.
@goto :eof
:help
@echo off
echo Creates picture with system info on the login screen.
echo.
echo PCINFO [/?] [/V] [/D]
echo.
echo   /V      Version history
echo   /D      Debugging
echo.
echo PCINFO uses the Sysinternals utility BGINFO (http://www.sysinternals.com)
echo to create a bitmap with system information.  This screen can be used
echo directly by Windows NT, 2000, XP, or 2003, but needs to be converted
echo for use by Windows 7 or Windows Server 2K8.
echo.
echo To convert the image it uses a LFC, a free command-line file converter
echo from LEAD Tools (http://www.leadtools.com).
echo.
echo Both BGINFO and LFC are stored in a .\bin subdirectory from the PCINFO
echo script.  The bitmap generated by BGINFO is stored in an .\output
echo subdirectory (which is created if it does not already exist).
echo.
echo If the path for the PCINFO tool needs to change, open the BGINFO.BGI
echo file in the same directory as the script and change a) the output
echo directory for the bitmap (under Bitmap:Location), and b) the _pcinfo
echo custom field location (under Fields:Custom; this is a VBscript file
echo in the same directory which parses NIC information).
echo.
@goto :eof
:version
@echo off
echo.
echo Written by Adam Hauerwas, hauerwas@providence.edu
echo.
echo See http://forum.sysinternals.com/topic20426.html for description of
echo approach and operation.  Latest version can be downloaded from
echo http://dl.dropbox.com/u/13326617/pcinfo.zip
echo.
echo 03/19/2010 - Version 1.0 released
echo 12/29/2010 - Version 1.5 released
echo.
@goto :eof

 
PCINFO.VBS:

Const iPad = 20
Set WSHShell = CreateObject("WScript.Shell")
'Subroutines
'Output tabular data
Sub Output (strLeft, strRight)
 Do While InStr(strRight, "  ") > 0
  strRight = Replace(strRight, "  ", " ")
 Loop
 strOutput = Left(strLeft & String(iPad," "),iPad) & vbTab & strRight
 Echo strOutput
End Sub
'Output host name, specs, deployment date and image tag
'Get Install Date using WMI
'Taken from http://msdn.microsoft.com/en-us/library/aa394596(v=vs.85).aspx
strComputer = "."
strImage = WSHShell.Environment.item("_image")
if strImage <> "" Then strImage = ", Image " & strImage
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" _
 & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
 ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
 Output Field("Host Name"), _
 (Field("CPU") & ", " & Field("Memory")) _
 & " (Deployed " & Left (objOperatingSystem.InstallDate, 8) _
 & strImage & ")"
Next
'Parse the MAC address and NIC arrays to matched pairs
'(and ignore Bluetooth or Juniper adapters)
'
arrMAC = Split ( Field("MAC Address"), CHR(11) )
arrNIC = Split ( Field("Network Card"), CHR(11) )
For iLoop = 0 to UBound(arrMAC)
 MAC = Replace( arrMAC(iLoop), CHR(11), "", 1, -1, 1 )
 NIC = Replace( arrNIC(iLoop), CHR(11), "", 1, -1, 1 )
 If InStr(NIC, "Bluetooth") + InStr(NIC, "Juniper") = 0 Then Output MAC, NIC
Next
Echo ""
Echo Field("Snapshot Time")



Edited by hauerwas - 08 March 2011 at 8:16pm
Adam Hauerwas
hauerwas@providence.edu
Back to Top
somarr View Drop Down
Groupie
Groupie


Joined: 30 December 2005
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote somarr Quote  Post ReplyReply Direct Link To This Post Posted: 04 April 2010 at 5:55am
Adam,
 
Excellent documentation and solution!  I had investigated this but as it was not a priority I did not have time to create a solution.  Yours works great in my initial testing.
 
I would like to add your solution avoids the hacks that I did not want to attempt in a coporate environment.
 
Thanks for your efforts!
 
 


Edited by somarr - 04 April 2010 at 5:57am
Back to Top
newalloy View Drop Down
Newbie
Newbie


Joined: 22 June 2010
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote newalloy Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2010 at 11:11pm
Adam... THANK YOU for putting this together.

And yes... I would LOVE for BGInfo to support a jpg option, or a feature that exports logon backgrounds (writes to oobe\info\backgrounds in jpg format)
Back to Top
 Post Reply Post Reply Page  123 5>
  Share Topic   

Forum Jump Forum Permissions View Drop Down