VBS2EXE CommandLine & .FNT Tool Editor Updates

Categories: FONTS, TOOL, Tools
Tags: ,
Comments: 4 Comments
Published on: September 5, 2014

I have two small tool updates available for download.??

VBScript to Win32 Executable Tool

My VBS2EXEcutable tool used to be GUI only. Using the tool myself to generate quick “Uninstall” links for most of my tools that the user does not have to search for it in the Windows Control Panel, I realized that a command line version is really what I need, to generate a new Uninstaller EXE via a pre-configured batch file in the programs project directory.

VBS2EXE Command Line by Roy/SAC 

VBS2EXECommandLine.exe <SCRIPT> <EXE> [/mode:w|c|s] [/batch]
                                      [/icon:<ICON>] [/h|/?]

VBS2EXECommandLine.exe <SCRIPT>
<SCRIPT> = the script file to process for example c:\temp\myscript.vbs 


<EXE> = The Output EXE File Name*

* If suppressed, read settings from script file is assumed.
  See 'Settings from Script' below.

/mode: c|w|s = Script Execution Mode (Default: c)
   'c' (or 'cscript' or 'cscript.exe') = Use CScript
   'w' (or 'wscript' or 'wscript.exe') = Use WScript
   's' (or 'start' or 'direct') = Call Directly

/icon:<ICON> = Optional, Path to .ICO Icon File to Include


/batch = Use Batch mode. Only valid for CScript to enabled /b Option

/? or /h  = This help screen

Settings from Script:

Conversion options are automatically added to <SCRIPT> Source.
This allows the simple execution of this tool the next time
You only need to pass on the <SCRIPT> file as the only parameter.
You can also add the settings yourself before hand, if you wish.

The Settings are stored as Script Comments at the beginning of the
Script. Nothing else except an 'Options Explicit' statement is allowed
before it (including other comments)


Notes: Use full paths for <EXE> and <ICON>
BTC=Batch, 1 = True, 0 = False


.FNT Tool Editor

I just introduced this little tool a couple days ago and already there is an update :).

I thought that it would be neat to include a font editor to manipulate individual characters or create a whole new font yourself altogether.

That was actually not that hard to implement. You can find screenshots and the new version 1.1 for download at the .FNT Tool main product page on my web site.??

VBS 2 EXE Bonus (Uninstall Script)

I mentioned the Uninstall Script that I use for my tools. I think that it might comes handy for some of you folks as well, so I am going to share it with you. Further below is a download link to the source code as ZIP archive.


' Settings to Modify per Program
Const ProgName = "VBS2EXE"
Const ProgVer = "1.0.0"

Const is64Bit = False

' Don't modify anything below this line!
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject") 
Dim SH : Set SH = CreateObject("WScript.Shell")
Dim aEnum , iCnt,ax, sVal, sVal2,sKeYRoot, NO_EXIST, TS, Dic 

NO_EXIST = "80070002"
If is64Bit = True Then
 sKeYRoot = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
 sKeYRoot = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
End If 
iCnt = REGEnumSubKeys(sKeYRoot,aEnum)

If iCnt &gt; 0 Then
    For Each ax In  aEnum
        sVal = REGReadValue(sKeYRoot & "\" & ax & "\DisplayName", "S") 
        sVer = REGReadValue(sKeYRoot & "\" & ax & "\DisplayVersion", "S") 
        If sVal = ProgName And sVer = ProgVer Then
            sVal = REGReadValue(sKeYRoot & "\" & ax & "\UninstallString", "S") 
            SH.Run sVal, , False : WScript.Quit(0)
        End If
End If    

Function REGEnumSubKeys(RegPath, byref AList)
    Dim sKey, sTemp, A1, Dic, TS, s1, LB, LenP, Pt1, sName
    On Error Resume Next
    If Mid(RegPath, 4, 1) = "\" Then 
        sKey = "HKEY_USERS" 
        sKey = TranslateREGKey(Left(RegPath, 4)) 
    End If    
    If (sKey = "") Then 
        REGEnumSubKeys = -1 
        Exit Function 
    End If    
    sTemp = FSO.GetSpecialFolder(2) & "\regk.reg.txt"
    If FSO.FileExists(sTemp) Then FSO.DeleteFile sTemp, True
    sKey = sKey & Right(RegPath, (Len(RegPath) - 4)) 
    LB = "["
    SH.Run "REGEDIT /E:A """ & sTemp & """ " & _
           Chr(34) & sKey & Chr(34), , True  
    If (FSO.FileExists(sTemp) = False) Then 
       REGEnumSubKeys = -2 
       Exit Function 
    End If
    LenP = Len(sKey) + 1 : sKey = LB & sKey
    Set Dic = CreateObject("Scripting.Dictionary") 
    Set TS = FSO.OpenTextFile(sTemp, 1)
    Do While TS.AtEndOfStream = False
        s1 = TS.readline
        If (Left(s1, 1) = LB) Then
            If (Left(s1, LenP) = sKey) Then  
                Pt1 = InStr((LenP + 2), s1, "\") 
                If (Pt1 = 0) Then Pt1 = InStr(LenP, s1, "]") 
                If Pt1 = 0 Then   
                    REGEnumSubKeys = -3 
                    Set Dic = Nothing 
                    Exit Function 
                End If
                sName = Mid(s1, (LenP + 2), Pt1 - (LenP + 2))
                If (sName &lt;&gt; "") And (Dic.Exists(sName) = False) Then 
                   Dic.add sName, sName  
                End If
            End If 
        End If    
    TS.Close : Set TS = Nothing
    If (Dic.Count &gt; 0) Then AList = Dic.keys 
    FSO.DeleteFile sTemp, True
    REGEnumSubKeys = Dic.Count 
End Function
Function REGReadValue(RegPath, sType)
    Dim r, i, i2, A1(), Ub
    On Error Resume Next
    Err.Clear : sType = GetType(RegPath)
    If sType = "E" Then 
        REGReadValue = "" 
        Exit Function 
    End If
    r = SH.RegRead(RegPath)  
    Select Case sType  
        Case "S", "N" : REGReadValue = r
        Case "X" : REGReadValue = SH.ExpandEnvironmentStrings(r)
        Case "BN", "BS"
        Ub = UBound(r) : ReDim A1(Ub)
        For i = 0 To UBound(r)
            A1(i) = Hex(r(i))  
        REGReadValue = A1
    End Select       
End Function
Function TranslateREGKey(sKeyIn)
    Dim s1 : s1 = UCase(sKeyIn)
    Select Case s1
        Case "HKCR" : TranslateREGKey = "HKEY_CLASSES_ROOT"
        Case "HKCU" : TranslateREGKey = "HKEY_CURRENT_USER"
        Case "HKLM" : TranslateREGKey = "HKEY_LOCAL_MACHINE" 
        Case "HKU" : TranslateREGKey = "HKEY_USERS"
        Case Else : TranslateREGKey = ""
    End Select         
End Function    

Download Source Code as ZIP (UNINSTALL.ZIP)

That’s it now. Enjoy and Cheers!

Carsten aka Roy/SAC






  1. Luke Schnabel says:

    Hello Roy, I am glad that i found you and also quite glad to see that you’re still updating regularly! I am hoping you could help me get into contact with Joan Stark. I cannot find any up to date contact information for her, i was very fortunate to find your website through one of the older portals… If you could please return a message to me via my email i would greatly appreciate it.