The two basic principles of Windows system administration:
For minor problems, reboot
For major problems, reinstall
R&D professional
Q. How can I install a font from the command line/batch file?
A. When you install a font all it does is copy the .ttf file to the %systemroot%\fonts and add an entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts. This can be automated with a batch file as follows
code:
1 2 3 Rem fontinst.bat copy akbar.ttf %systemroot%\fonts regedit /s font.reg
The font.reg would contain the following:
code:
1 2 3 4 REGEDIT4 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] "Akbar Plain (TrueType)"="akbar.ttf"
In this example it copies akbar.ttf which is called "Akbar Plain (TrueType)" (yes its the Simpsons font ;-) ). The reg scipt actually creates a value called "Akbar Plain (TrueType)" under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts with its contents "akbar.ttf". The new font would be visable once the machine has been rebooted.
If you have some older 16bit applications you may want to add the font to win.ini as well in the [fonts] section. This could be accomplished using a .inf file, e.g.
code:
1 2 [UpdateInis] "E:\WINNT\WIN.INI","Fonts",,"Akbar Plain (TrueType)=akbar.ttf"
[ Voor 94% gewijzigd door Spider.007 op 16-08-2003 17:28 ]
---
Prozium - The great nepenthe. Opiate of our masses. Glue of our great society. Salve and salvation, it has delivered us from pathos, from sorrow, the deepest chasms of melancholy and hate
1
2
3
4
| Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] "MSI Console"="Msifont.fon" |
Jammer dat er geen command voor is...
The two basic principles of Windows system administration:
For minor problems, reboot
For major problems, reinstall
Dat is dan je installatie van het font.
Neem je whisky mee, is het te weinig... *zucht*
maar zo werkt het idd net zo makkelijk:
Msifont.reg
1
2
3
4
5
6
7
| Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] "MSI Console"="Msifont.fon" [HKEY_CURRENT_USER\Software\Microsoft\Notepad] "lfFaceName"="MSI Console" |
Msifont.bat
1
2
| copy Msifont.fon %systemroot%\fonts regedit /s Msifont.reg |
ps. hij geeft wel een vage foutmelding als het font al bestaat:
F:\font>copy Msifont.fon C:\WINNT\fonts
The requested operation cannot be performed on a file with a user-mapped section open.
The two basic principles of Windows system administration:
For minor problems, reboot
For major problems, reinstall
Jimbolino schreef op 16 August 2003 @ 23:25:
jah i know, maar ik dacht dat je (net als bij het registreren van een .ocx) dit met een command kon doen...
Als je die manier al wist, geef dat ajb. alvast aan, ten eerste zodat anderen niet de moeite hoeven doen om die manier uit te leggen (en mensen dus harder nadenken over een andere manier), ten tweede zodat mensen die dit topic later in de search vinden, er nog meer van leren
Als je daar van af wilt, kan je if exist gebruiken om van te voren te controleren of het al bestaat en alleen te kopieren als dat nodig isps. hij geeft wel een vage foutmelding als het font al bestaat:
F:\font>copy Msifont.fon C:\WINNT\fonts
The requested operation cannot be performed on a file with a user-mapped section open.
Maar wel een aparte foutmelding, die zie ik voor het eerst
[ Voor 5% gewijzigd door F_J_K op 17-08-2003 00:33 ]
'Multiple exclamation marks,' he went on, shaking his head, 'are a sure sign of a diseased mind' (Terry Pratchett, Eric)
http://www.vb-helper.com/index_windows.html
misschien was ik een beetje onduidelijk in mijn topicstart
"ik wil het niet op de "dirty" manier doen, en simpelweg het halve register in een file opslaan"
The two basic principles of Windows system administration:
For minor problems, reboot
For major problems, reinstall
Ik wilde hier schrijven dat gewoon kopieren wel werkt maar dat blijkt toch niet zo. Toen ik het testte had ik de fonts folder open staan in explorer. Dan werkt het wel, ook als je em in een cmd kopieertJimbolino schreef op 15 August 2003 @ 18:10:
Gewoonweg copieren naar de map c:\winnt\fonts is niet genoeg, want dan kent windows hem niet.
Als je een beetje kan programmeren kan je dit met een paar regels code wel doen volgens mij (bestand kopieren, AddFontResource), dan heb je zeker de goede methode.
de font copieerd zoals het moet, de keys maakt ie aan, de font komt in de lijst te staan als je naar c:\winnt\fonts gaat
maar hij komt niet in het lijstje van notepad te staan
pas als ik hem delete en opnieuw naar de fonts map sleep werkt het
The two basic principles of Windows system administration:
For minor problems, reboot
For major problems, reinstall
Verwijderd
Verwijderd
Doe je met WinInstall LE van de w2ks CD
( ik bedoel je zit zo te scripten en te .reggen je zult een AD hebben? )
Dit is een programma waarmee je via een commandline fonts kan installeren.
(Gebruikers dienen wel rechten te hebben om fonts te installeren)
Handleiding :
Je maakt een dir. aan en plaatst daar de Fonts in
Copieer de inhoud van het zipbestand naar deze dir.
Edit fontinst.ini en zet hier de te installeren fonts in.
Run op het werkstation fontinst.exe
Suc6
[ Voor 41% gewijzigd door Luppie op 18-09-2003 09:41 ]
Heb je iets aan mijn antwoord ? Een thumbs-up wordt zeker op prijs gesteld.