by admin

Installing Fonts Windows 7 Script Host

Installing Fonts Windows 7 Script Host 5,6/10 9932 votes
Installing Fonts Windows 7 Script Host

. Installing Fonts with PowerShell and Group Policy Scriptshas worked so far. While it accomplishes my goal of installing fonts (without visiting every single machine), it has two downsides. First, Group Policy Software Installation requires a reboot to process. Second, an administrator is still needed to package the MSI. Because I love automation, this drove me crazy! How can I get out of the font deploying business?

Installing Fonts Windows 7 Script Host 2017

Let my users start installing fonts with PowerShell.Using VB to Install Fonts with PowerShellOk – so it isn’t as easy as a single cmdlet. But I did find a PowerShell script that was based on a VB Script. The problem: beginning in Windows 7, fonts could not be installed from a Network Location. The solution: a simple Copy-Item command. Without further ado, here is our script. The only configuration needed is to set the NetworkPath variable. Fonts should be placed directly into this folder without any sub-folders.

Windows Script Host Windows 10

Installing fonts windows 7 script host 2017

If desired, you can change the LocalPath variable to a hidden location. Either way, our script will create the local font storage folder and copy any item from the network location to the local machine. The script will then install and register each Font by using the Windows Font viewer.

This keeps us from manually having to edit the registry. Finally, our script runs a Test-Path check to ensure we are overwriting existing fonts.

Group Policy PreferencesTo delegate this task, we are going to use Group Policy Preferences: Scheduled Tasks. Create a new GPO named Install Fonts – then create a new preference. Change the Task user from your account to a dedicated service account. Remember that this account will need read access to your network share and will need to be a local administrator of any machine that will need fonts.

This user will also need the Run as Batch permission.On the Triggers Tab, create a new Daily trigger. Set it to repeat at a regular interval. Because my users are used to waiting an hour or so for other preferences to apply, I set mine to an hour. Depending your user’s patience, you can have the task repeat up to every 5 minutes.On the Actions Tab, create a new action that calls PowerShell.exe. For your arguments, specify -noprofile “PATH-TO-YOUR-SCRIPT.PS1”. Hi Joseph,yes, the registry is ok. I can see the script creates entries in registry, but no copies any files to c:windowsfonts.from network share to C:UsersPublic files are copied, it is ok.UAC disabled.Hereis transcript of execution:Machine: TEST-VM (Microsoft Windows NT 6.1.7601 Service Pack 1).Transcript started, output file is C:PStranscript.txtDirectory: C:UsersPublicMode LastWriteTime Length Name—- ————- —— —-d—- 0:12 Fonts.Windows PowerShell Transcript EndAny thougts?

I had a lot of trouble finding useable VBS scripts to install and delete fonts from Windows 7 via sccm. Maybe everyone is using Powershell now instead, or I am missing something?

If you have a better or different solution, I would love to see it.Either way, I was able to put the following 2 scripts together. They work by parsing all ttf and otf files in the current folder, and then installing/removing them. One gotcha under SCCM is it requires a reboot for the changes to come into effect.CheersINSTALL:-Option Explicitdim WinScriptHostDim objShell, objFSO, wshShellDim strFontSourcePath, objFolder, objFont, objNameSpace, objFileSet objShell = CreateObject('Shell.Application')Set wshShell = CreateObject('WScript.Shell')Set objFSO = createobject('Scripting.Filesystemobject')strFontSourcePath = objFSO.GetAbsolutePathName('.'