# BGinfo Powershell script

**URL:** <https://forums.powershell.org/t/bginfo-powershell-script/23176>\
**Category:** PowerShell Help\
**Created:** [November 17, 2023, 4:58pm UTC](https://forums.powershell.org/t/bginfo-powershell-script/23176 "2023-11-17T16:58:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghostrider91](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@ghostrider91](https://forums.powershell.org/u/ghostrider91)\
**Post date:** [November 17, 2023, 4:58pm UTC](https://forums.powershell.org/t/bginfo-powershell-script/23176/1 "2023-11-17T16:58:04Z")

</div>

Hello Guys, can anyone help me out building a powershell script to install BGinfo but also I need it to show only IP address, host name and that’s it. I created the one below but it gives me an error.

# Define the download URL for BGInfo

$bginfoUrl = “[https://live.sysinternals.com/Bginfo.exe](https://live.sysinternals.com/Bginfo.exe)”

# Define the download location

$downloadPath = “C:\Temp\Bginfo.exe”

# Download BGInfo

Invoke-WebRequest -Uri $bginfoUrl -OutFile $downloadPath

# Define the BGInfo configuration file

$bginfoConfig = @"  
[BgInfo]  
use3d=0  
popupdelay=0  
"@

# Save the configuration to a file

$bginfoConfigPath = “C:\Temp\BginfoConfig.bgi”  
$bginfoConfig | Out-File -FilePath $bginfoConfigPath -Encoding ASCII

# Install BGInfo with the specified configuration

Start-Process -FilePath $downloadPath -ArgumentList “/SILENT”, “/NOLICPROMPT”, “/TIMER:0”, “/NOSPLASH”, “/ACCEPTLICENSE”, “/LOADCONFIG:$bginfoConfigPath”

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [November 17, 2023, 6:01pm UTC](https://forums.powershell.org/t/bginfo-powershell-script/23176/2 "2023-11-17T18:01:31Z")

</div>

Christopher,  
Bienvenido / Welcome to the forum. 👋🏼

before we proceed … When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( \</\> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

[How to format code in PowerShell.org](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/b/bee50c628238f2c076c0504efb6b15f2fb11f002.gif) 1 \<---- Click 👆🏽 😉

( !! Sometimes the _preformatted text_ button hides behind the settings gear symbol. 😉 )

> [@ghostrider91](#):
>
> script to install BGinfo

May I ask some more background info? Is it only for you / one computer or do you want to install it on many computers? If “yes” - are these computers in an enterprise network, maybe in an Active Directory Domain?

> [@ghostrider91](#):
>
> but it gives me an error.

What errors? Please - since errors are an important language feature telling you what’s wrong and sometimes even how to fix it - you should share the complete errror message (formatted as code as well please!).

> [@ghostrider91](#):
>
> # Define the BGInfo configuration file
> 
> $bginfoConfig = @"  
> [BgInfo]  
> use3d=0  
> popupdelay=0  
> "@

That looks quiet simple if I compare it to the \*.bgi files I have seen so far. Have you tried if that’s a sufficient BGInfo config file?

> [@ghostrider91](#):
>
> # Install BGInfo with the specified configuration
> 
> Start-Process -FilePath $downloadPath -ArgumentList “/SILENT”, “/NOLICPROMPT”, “/TIMER:0”, “/NOSPLASH”, “/ACCEPTLICENSE”, “/LOADCONFIG:$bginfoConfigPath”

That’s actually not _ **installing** _ it - it’s actually just starting it. If you want to start BGInfo when WIndows starts you have to run this command line with one of the available auto start options in Windows.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:14pm UTC](https://forums.powershell.org/t/bginfo-powershell-script/23176/3 "2024-05-16T20:14:34Z")

</div>

Closed on May 16, 2024, 8:14pm UTC


