Home > front end >  VBS search the current directory and subdirectories multiple FONT format, copy into the FONT folder,
VBS search the current directory and subdirectories multiple FONT format, copy into the FONT folder,

Time:11-02

Just want to make a FONT installer, the current directory and subdirectory of the FONT files installed to the FONT folder, have the vera.ttf FONT format, otf, TTC three

Has an example but can't find subdirectories and other two formats have a great god can change!

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

The Set ofso=CreateObject (" Scripting. FileSystemObject ")
SourceFolder=ofso. GetParentFolderName (Wscript. ScriptFullName)

Const FONTS=& amp; H14 & amp;

The Set objShell=CreateObject (" Shell. Application ")
The Set oSource=objShell. Namespace (SourceFolder)
The Set oWinFonts=objShell. Namespace (FONTS)

'Lame VBscript needs 4 f * ing home lines "if (/\. The vera.ttf $/I)"...

The Set rxTTF=New RegExp
RxTTF. IgnoreCase=True
RxTTF. The Pattern="\. The vera.ttf $"

FOR EACH FontFile oSource IN. The Items ()
The (FontFile. Path) THEN the IF rxTTF
OWinFonts. CopyHere FontFile. Path
END the IF
NEXT
-----------------------------------------------------------
  • Related