Daily IT Matters, this is the place where I post my daily findings on IT.

Monday, August 10, 2009

Copy fonts using script for unattended vista install

I had to create a vbscript to copy fonts from a network share for an unattended vista (or windows 7) install

Const FONTS = &H14&
Set objShell = CreateObject("shell.Application")
Set objFolder = objShell.Namespace(FONTS)
strdir = "\\srv001\REMINST\Drivers\Finalize\Fonts"


Sub EnumDir(strdir)
dim FSO,f,fc
set FSO=Wscript.CreateObject("scripting.FileSystemObject")
If fso.FolderExists(strDir) then
set f=fso.GetFolder(strDir)
set fc=f.files
if fc.Count > 2 then
for each fl in fc
objFolder.CopyHere strdir & "\" & fl.name
End If
wscript.echo "Folder " & strDir & " NOT found"
end if
End Sub

No comments: