Jump to content

Mike88

Member
  • Posts

    41
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Luxembourg

Posts posted by Mike88

  1. Well after google'ing for [GetExtensionName Namespace(FONTS)] i could assemble a working VBScript from 2 VBScript. :)

    Set sho = CreateObject("Shell.Application")Set fso = CreateObject("Scripting.FileSystemObject")Const FONTS = &H14&Set fontNamespace = sho.Namespace(FONTS)Set folder = fso.getfolder(".")Set extensions = CreateObject("Scripting.Dictionary")extensions.CompareMode = 1 'Make lookups case-insensitive.extensions.Add "fon", Trueextensions.Add "otf", Trueextensions.Add "pfm", Trueextensions.Add "ttf", TrueFor Each file In folder.Files  If extensions.Exists(fso.GetExtensionName(file)) Then    fontNamespace.CopyHere folder & "\" & fso.GetFileName(file)  End IfNextWScript.Quit
  2. @jaclaz

    Unfortunately a Batch Script doesn't register the Fonts. :} I Tried 4 of them before moving to VBScript. :)

     

    @bphlpt

    I know this regfont tool but i will use this VBScript on 2 different scenarios one to automatically install Windows XP Theme Fonts and second to include the Script into some Custom Theme Font folder so that a User can easily install the Fonts if needed.

  3. Subfolders are not needed it's only an example i posted. If i'm not wrong then this "GetExtensionName" command should solve the problem with the different Windows Languages and the Right to Left text format.

    I only don't know how to do this Font Script with the "GetExtensionName" from the example scripts i posted.

     

    https://msdn.microsoft.com/en-us/library/x0fxha2a%28v=VS.85%29.aspx?f=255&MSPPError=-2147217396

    Script example 1:

    For Each objFile in colFiles    If UCase(objFSO.GetExtensionName(objFile.name)) = "PDF" Then        Wscript.Echo objFile.Name    End IfNext

    Script example 2:

    Set extensions = CreateObject("Scripting.Dictionary")extensions.CompareMode = 1 ' make lookups case-insensitiveextensions.Add "jpg", Trueextensions.Add "png", Trueextensions.Add "gif", TrueFor Each ObjFile In ObjFiles  If extensions.Exists(fso.GetExtensionName(ObjFile)) Then    ObjOutFile.WriteLine(ObjFile.Path)  End IfNext
  4. I really didn't change much at all. The script simply won't work when executing it via a Batch file which is located in another folder. And i tested it on Win7 x64 and WinXP x86.

     

    Batch:

    IF EXIST "New folder\Fonts Installer.vbs" START "" /WAIT "New folder\Fonts Installer.vbs"

    VBScript:

    Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")'-> Start Folder Where Script Is Located And List All Files  For Each i In Fso.GetFolder(".").Files'-> Filter Out The Files Change To Suit Your Needs   If LCase(Right(i.Name,3)) = "fon" Then    FontCopy(i.Path)   End If   If LCase(Right(i.Name,3)) = "otf" Then    FontCopy(i.Path)   End If   If LCase(Right(i.Name,3)) = "pfm" Then    FontCopy(i.Path)   End If   If LCase(Right(i.Name,3)) = "ttf" Then    FontCopy(i.Path)   End If  Next'-> Copy The File To The Font Folder   Function FontCopy(F)    Const FONTS = &H14&    Dim Shl :Set Shl = CreateObject("Shell.Application")    Dim Obj :Set Obj = Shl.Namespace(FONTS)    Obj.CopyHere F   End FunctionWScript.Quit
  5. HI,

    Would it be possible to modify this VBScript so that it would automatically install all Fonts located in the same folder as the VBScript with the Font file extensions .fon, .pfm, .ttc, .ttf, .otf?

    Const FONTS = &H14&Set objShell = CreateObject("Shell.Application")Set objFolder = objShell.Namespace(FONTS)objFolder.CopyHere "C:\Scripts\HandelGotD1.ttf"objFolder.CopyHere "C:\Scripts\HandelGotD2.fon"
  6. Yes the shell style is present in the Theme folder. What i also noticed is if you copy some files and then move a window over the copy progress bar then the progress bar will jumps up.

    In my opinion there is some kind of progress bar bug in this Theme. :unsure:

  7. The funny thing is that nLite had this already included but it was done with "00" instead with "\" but then it was completely removed. :(

    And ElTorqiro removed his tool that checked the nLite WinXP source directory and added an "\" behind the file names path in the sfcfiles.dll file if a file name was not found in the nLite WinXP source directory. :}

  8. If i would like to remove this lines below listed in the bintext.exe tool from the sfcfiles.dll file how would you do this?

    000000097EE8   000066798CE8      0   %ProgramFiles%\Microsoft FrontPage\version3.0\bin\fp98sadm.exe000000097F80   000066798D80      0   %ProgramFiles%\Microsoft FrontPage\version3.0\bin\fp98swin.exe000000002600   000066703400      0   %ProgramFiles%\Microsoft FrontPage\version3.0\bin\fp98sadm.exe

    I also find this lines with the XVI32 (Hex Editor) but i'm not sure if i should remove them or replace them with  "00", and if that's also all i have to do.

    I'm not a pro in this kind of stuff more like a baby in diapers. :)

  9. This is the results i get on a Hard Disk that has a lot of files on it:

    22:32:10,3122:41:35,44 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:41:35,4422:41:50,71 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:41:50,7122:42:05,87 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:42:05,8722:42:21,01 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:42:21,0122:42:35,93 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:42:35,93Press any key to continue . . .

    [EDIT]

    I'm having the feeling that this is not really faster because if i look at the "DIR" command then it will always start scanning all the directories from A to Z.

    The first "DIR" scan on an Hard Disk will be always the slowest if i run it a second time then i get a different result.

    22:52:35,6822:52:56,26 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:52:56,2622:53:12,12 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:53:12,1222:53:28,04 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:53:28,0422:53:44,40 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:53:44,4022:54:00,89 FOUND F:\xfolder1\OEM\RunOnceEx\newtest.cmd22:54:00,89Press any key to continue . . .
×
×
  • Create New...