[Solved] Install font batch file and vbscript


Finally I found the solution, special thank to JosefZ, as he said Powershell is the solution, All you need is download and copy Add-font.ps1 by Michael Murgolo to your project folder and copy below lines into your batch file:

@echo off
PowerShell Set-ExecutionPolicy RemoteSigned
PowerShell -command "& '%~dp0Add-Font.ps1' -path '%~dp0myFont.ttf'"

Note you must run this script as Administrator, hence you need to add %~dp0 before your files.

Thats all, you even don’t need the codes in my question, good luck.

solved Install font batch file and vbscript