Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

[VBS] Automatically Install Fonts

- - - - -

  • Please log in to reply
28 replies to this topic

#26
Outbreaker

Outbreaker

    Advanced Member

  • Member
  • PipPipPip
  • 325 posts
  • Joined 08-August 07
  • OS:Windows 7 x86
  • Country: Country Flag

HI,

Is it possible to modify this script to support a silent install command (/s) to suppress the MSG Box when a Font is already installed?

Const FONTS = &H14&
Dim Dic :Set Dic = CreateObject("Scripting.Dictionary")
Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Shl :Set Shl = CreateObject("Shell.Application")
Dim Fns :Set Fns = Shl.Namespace(FONTS)
Dim i,v :v = Array("fon","otf","pfm", "ttf")
  For Each i In v
   Dic.CompareMode = 1 'Make lookups case-insensitive.
   Dic.Add i, True
  Next
  For Each i In Fso.getfolder(".").Files
   If Dic.Exists(Fso.GetExtensionName(i)) Then
    Fns.CopyHere i.Path
   End If
  Next

Edited by Outbreaker, 26 July 2015 - 03:46 PM.



How to remove advertisement from MSFN

#27
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,242 posts
  • Joined 02-August 03
  • OS:none specified
  • Country: Country Flag
Short answer No, not that I know of.


GunSmokingMan



#28
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

How does powershell work for this task?

$ShApp = New-Object -ComObject Shell.Application
$Fonts = $ShApp.NameSpace(0x14)
$Extns = @("*.otf","*.ttf")
GCI -Include "$Extns" | %\{$Fonts.CopyHere($_.FullName)\}


#29
Outbreaker

Outbreaker

    Advanced Member

  • Member
  • PipPipPip
  • 325 posts
  • Joined 08-August 07
  • OS:Windows 7 x86
  • Country: Country Flag

I would use this on WinNT5.0 and up and PowerShell is only directly included in Win6.1. :(

If supresssing this MSG Box is not possible with a VBScript would it then be possible to skip the CopyHere with a silent switch (/s) when a Font file is already installed?


Edited by Outbreaker, Today, 06:27 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users