Japanatron Logo

I found this awesome Windows powershell script that allows you to install fonts via the command line.  This is very convenient for mass deployment.

$ssfFonts = 0x14
$fontSourceFolder = "\\PATH\TO\FONTS"
$Shell = New-Object -ComObject Shell.Application
$SystemFontsFolder = $Shell.Namespace($ssfFonts)
$FontFiles = Get-ChildItem $fontSourceFolder
$SystemFontsPath = $SystemFontsFolder.Self.Path
$rebootFlag = $false

foreach($FontFile in $FontFiles) {
    # $FontFile will be copied to this path:
    $targetPath = Join-Path $SystemFontsPath $FontFile.Name
    # So, see if target exists...
    if(Test-Path $targetPath){
        # font file with the same name already there.
        # delete and replace.
        $rebootFlag = $true
        Remove-Item $targetPath -Force
        Copy-Item $FontFile.FullName $targetPath -Force
    }else{
        #install the font.
        $SystemFontsFolder.CopyHere($FontFile.fullname)
    }
}

#Follow-up message
if($rebootFlag){
    Write-Host "At least one existing font overwritten. A reboot may be necessary."
}

Related Articles

Combine Image File and Audio F...

I wanted to figure out a way to quickly and easily combine an image file (jpg) and audio file (mp3) into a video file (mov) using the free media converter tool ...

The Hunt for the Ultimate Free...

In the hopes of reducing my monthly smartphone bill, I've been investigating the current state of VoIP and its potential to completely replace the traditional m...

Joomla Running on Nginx and Ub...

What follows is an outline I compiled while researching how to tighten security on a Nginx web server. NOTE 1: Ubuntu 14.04 LTS was used for this. NOTE 2: This ...

The Hunt for the Ultimate Free...

I spent some time researching top-rated, but free antivirus security software for both Mac and Windows.  There are far more free antivirus software solutions ou...