elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [BATCH] [APORTE] TextFont Installer (Instalador automático de fuentes de texto)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [BATCH] [APORTE] TextFont Installer (Instalador automático de fuentes de texto)  (Leído 4,546 veces)
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.813



Ver Perfil
[BATCH] [APORTE] TextFont Installer (Instalador automático de fuentes de texto)
« en: 24 Octubre 2012, 18:05 pm »

Un pequeño code que me he hecho para automatizar la instalación de muchas fuentes de texto TTF u OTF EN WINDOWS 7...
Viene bien para ciertos casos así que aquí lo dejo por si alguien anda buscando algo parecido.

(Versión 0.2)



Código
  1. @ECHO OFF
  2. Mode con COLS=60 LINES=3
  3. TITLE Text Font Installer (By Elektro H@cker^) v0.2
  4. Nircmd win center ititle "Fuentes TrueType" 2>NUL
  5. COLOR 07
  6.  
  7. :: Modo de instalación normal
  8. REM Instalador.bat
  9. :: Modo de instalación recursiva
  10. REM Instalador.bat -R
  11.  
  12. Takeown /F "%SystemRoot%\Fonts" >NUL
  13. Icacls "%SystemRoot%\Fonts" /Grant "%USERNAME%":(F) >NUL
  14. Attrib -R -S "%SystemRoot%\Fonts" >NUL
  15.  
  16. IF /I "%~1" EQU "-R" (Set "DIR_RECURSIVE=/S" & Set "FOR_RECURSIVE=/R")
  17.  
  18. For /F %%X in ('Dir /B %DIR_RECURSIVE% "*.OTF"; "*.TTF" ^| FIND /V /C ""') Do (SET "Total=%%X")
  19.  
  20. For %FOR_RECURSIVE% %%# in (*.otf; *.ttf) DO (
  21. Set /A "Counter+=1"
  22. IF /I "%%~x#" EQU ".OTF" (Call SET "Font_Type=OpenType") ELSE (Call SET "Font_Type=TrueType")
  23. CALL Echo: Instalando fuentes de texto...  ( %%COUNTER%% de %%TOTAL%% ^)
  24. Echo: [+] %%~nx#
  25. CALL REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /V "%%~n# (%%Font_Type%%)" /D "%%~nx#" /F >NUL
  26. CALL REG ADD "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Fonts" /V "%%~n# (%%Font_Type%%)" /D "%%~nx#" /F >NUL
  27. COPY /Y "%%#" "%SystemRoot%\Fonts\" >NUL
  28. )
  29.  
  30. Echo: Las fuentes de texto se han instalado!
  31. Timeout /T 3



Versión alternativa del script (Se reduce el molesto efecto del borrado de pantalla, pero la ventana queda más pequeña, menos bonita xD)
Código
  1. @ECHO OFF
  2. Mode con COLS=60 LINES=5
  3. TITLE Text Font Installer (By Elektro H@cker^) v0.2
  4. Nircmd win center ititle "Fuentes TrueType" 2>NUL
  5. COLOR 07
  6.  
  7. :: Modo de instalación normal
  8. REM Instalador.bat
  9. :: Modo de instalación recursiva
  10. REM Instalador.bat -R
  11.  
  12. Takeown /F "%SystemRoot%\Fonts" >NUL
  13. Icacls "%SystemRoot%\Fonts" /Grant "%USERNAME%":(F) >NUL
  14. Attrib -R -S "%SystemRoot%\Fonts" >NUL
  15.  
  16. IF /I "%~1" EQU "-R" (Set "DIR_RECURSIVE=/S" & Set "FOR_RECURSIVE=/R")
  17.  
  18. For /F %%X in ('Dir /B %DIR_RECURSIVE% "*.OTF"; "*.TTF" ^| FIND /V /C ""') Do (SET "Total=%%X")
  19.  
  20. For %FOR_RECURSIVE% %%# in (*.otf; *.ttf) DO (
  21. Set /A "Counter+=1"
  22. IF /I "%%~x#" EQU ".OTF" (Call SET "Font_Type=OpenType") ELSE (Call SET "Font_Type=TrueType")
  23. CALL Echo: Instalando fuentes de texto...  ( %%COUNTER%% de %%TOTAL%% ^) | MORE
  24. Echo: [+] %%~nx#
  25. CALL REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /V "%%~n# (%%Font_Type%%)" /D "%%~nx#" /F >NUL
  26. CALL REG ADD "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Fonts" /V "%%~n# (%%Font_Type%%)" /D "%%~nx#" /F >NUL
  27. COPY /Y "%%#" "%SystemRoot%\Fonts\" >NUL
  28. CLS
  29. )
  30.  
  31. Echo: Las fuentes de texto se han instalado!
  32. Timeout /T 3

Saludos


« Última modificación: 24 Octubre 2012, 18:31 pm por EleKtro H@cker » En línea

lahero85

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Re: [BATCH] [APORTE] TextFont Installer (Instalador automático de fuentes de texto)
« Respuesta #1 en: 12 Septiembre 2017, 19:26 pm »

Gracias me sirvio tu BATCH saludos.


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines