PoshCode Archive  Artifact [09cac587ac]

Artifact 09cac587acf04a19d68a30d16df93f45ca4452ac8f79e619bd5b825c4409f06c:

  • File Install-Bginfo.ps1 — part of check-in [a96cf98936] at 2018-06-10 13:56:39 on branch trunk — Install and run BGInfo at startup using registry method (user: Chad Miller size: 1132)

# encoding: ascii
# api: powershell
# title: Install-Bginfo.ps1
# description: Install and run BGInfo at startup using registry method
# version: 0.1
# author: Chad Miller
# license: CC0
# x-poshcode-id: 5525
# x-archived: 2015-09-19T14:28:03
# x-published: 2015-10-19T20:20:00
#
#
#Install and run BGInfo at startup using registry method as described here:
#http://forum.sysinternals.com/bginfo-at-startup_topic2081.html
#Setup 
#1. Download BgInfo http://technet.microsoft.com/en-us/sysinternals/bb897557
#2. Create a bginfo folder and copy bginfo.exe
#3. Create a bginfo.bgi file by running bginfo.exe and saving a bginfo.bgi file and placing in same directory as bginfo

if (Test-Path "C:\WINDOWS\system32\bginfo")
{ remove-item -path "C:\WINDOWS\system32\bginfo" -Recurse }

#Change \\Z001\d$\sw\bginfo to your SW distrib share
copy-item \\Z001\d$\sw\bginfo -Destination C:\Windows\system32 -Recurse

Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -name "BgInfo" -value  "C:\WINDOWS\system32\bginfo\Bginfo.exe C:\WINDOWS\system32\bginfo\bginfo.bgi /TIMER:0 /NOLICPROMPT"