{"id":994,"date":"2014-09-05T04:45:32","date_gmt":"2014-09-05T12:45:32","guid":{"rendered":"http:\/\/www.roysac.com\/blog\/?p=994"},"modified":"2014-09-05T04:46:48","modified_gmt":"2014-09-05T12:46:48","slug":"vbs2exe-commandline-fnt-tool-editor-updates","status":"publish","type":"post","link":"https:\/\/www.roysac.com\/blog\/2014\/09\/vbs2exe-commandline-fnt-tool-editor-updates\/","title":{"rendered":"VBS2EXE CommandLine &#038; .FNT Tool Editor Updates"},"content":{"rendered":"<p>I have <strong>two<\/strong> small tool updates available for download.??<\/p>\n<h2>VBScript to Win32 Executable Tool<\/h2>\n<p>My <a href=\"http:\/\/www.roysac.com\/roy-tools\/vbs2executable.html\" target=\"_blank\">VBS2EXEcutable<\/a> tool used to be GUI only. Using the tool myself to generate quick &#8220;<em>Uninstall<\/em>&#8221; 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.<\/p>\n<pre style=\"width: 795px;\">VBS2EXE Command Line by Roy\/SAC \r\n\r\n------------------------------\r\nUsage:\r\n------------------------------\r\nVBS2EXECommandLine.exe &lt;SCRIPT&gt; &lt;EXE&gt; [\/mode:w|c|s] [\/batch]\r\n                                      [\/icon:&lt;ICON&gt;] [\/h|\/?]\r\n\r\n------------------------------\r\nBasic:\r\n------------------------------\r\nVBS2EXECommandLine.exe &lt;SCRIPT&gt;\r\n&lt;SCRIPT&gt; = the script file to process for example c:\\temp\\myscript.vbs \r\n\r\n------------------------------\r\nParameters:\r\n------------------------------\r\n\r\n&lt;EXE&gt; = The Output EXE File Name*\r\n\r\n* If suppressed, read settings from script file is assumed.\r\n  See 'Settings from Script' below.\r\n\r\n\/mode: c|w|s = Script Execution Mode (Default: c)\r\n   'c' (or 'cscript' or 'cscript.exe') = Use CScript\r\n   'w' (or 'wscript' or 'wscript.exe') = Use WScript\r\n   's' (or 'start' or 'direct') = Call Directly\r\n\r\n\/icon:&lt;ICON&gt; = Optional, Path to .ICO Icon File to Include\r\n\r\n------------------------------\r\nSwitches:\r\n------------------------------\r\n\r\n\/batch = Use Batch mode. Only valid for CScript to enabled \/b Option\r\n\r\n\/? or \/h  = This help screen\r\n\r\n------------------------------\r\nSettings from Script:\r\n------------------------------\r\n\r\nConversion options are automatically added to &lt;SCRIPT&gt; Source.\r\nThis allows the simple execution of this tool the next time\r\nYou only need to pass on the &lt;SCRIPT&gt; file as the only parameter.\r\nYou can also add the settings yourself before hand, if you wish.\r\n\r\nThe Settings are stored as Script Comments at the beginning of the\r\nScript. Nothing else except an 'Options Explicit' statement is allowed\r\nbefore it (including other comments)\r\n\r\n'[VBS2EXE]\r\n'EXE=&lt;EXE&gt;\r\n'ICO=&lt;ICON&gt;\r\n'SHO=cscript.exe|wscript.exe|start\r\n'BTC=1|0\r\n'[\/VBS2EXE]\r\n\r\nNotes: Use full paths for &lt;EXE&gt; and &lt;ICON&gt;\r\nBTC=Batch, 1 = True, 0 = False\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h2>.FNT Tool Editor<\/h2>\n<p>I just <a href=\"http:\/\/www.roysac.com\/blog\/2014\/08\/a-little-fnt-tool-for-programmers\/\">introduced this little tool <\/a>a couple days ago and already there is an update :).<\/p>\n<p>I thought that it would be neat to include a font editor to manipulate individual characters or create a whole new font yourself altogether.<\/p>\n<p>That was actually not that hard to implement. You can find screenshots and the new version 1.1 for download at the <a title=\".FNT Tool for Programmers\" href=\"http:\/\/www.roysac.com\/roy-tools\/fnt-tool.html\" target=\"_blank\">.FNT Tool main product page <\/a>on my web site.??<\/p>\n<h2>VBS 2 EXE Bonus (Uninstall Script)<\/h2>\n<p>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.<\/p>\n<pre>[code language=\"VB\"]\r\n'[VBS2EXE]\r\n'EXE=ENTER PATH TO EXECUTABLE HERE\r\n'ICO=\r\n'SHO=cscript.exe\r\n'BTC=1\r\n'[\/VBS2EXE]\r\n\r\n'-----------------------------------------------------------------\r\n' Settings to Modify per Program\r\n'\r\nConst ProgName = &quot;VBS2EXE&quot;\r\nConst ProgVer = &quot;1.0.0&quot;\r\n\r\nConst is64Bit = False\r\n\r\n' Don't modify anything below this line!\r\n'-----------------------------------------------------------------\r\nDim FSO : Set FSO = CreateObject(&quot;Scripting.FileSystemObject&quot;) \r\nDim SH : Set SH = CreateObject(&quot;WScript.Shell&quot;)\r\nDim aEnum , iCnt,ax, sVal, sVal2,sKeYRoot, NO_EXIST, TS, Dic \r\n\r\nNO_EXIST = &quot;80070002&quot;\r\nIf is64Bit = True Then\r\n sKeYRoot = &quot;HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot;\r\nElse\r\n sKeYRoot = &quot;HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot;\r\nEnd If \r\niCnt = REGEnumSubKeys(sKeYRoot,aEnum)\r\n\r\nIf iCnt &amp;gt; 0 Then\r\n    For Each ax In  aEnum\r\n        sVal = REGReadValue(sKeYRoot &amp; &quot;\\&quot; &amp; ax &amp; &quot;\\DisplayName&quot;, &quot;S&quot;) \r\n        sVer = REGReadValue(sKeYRoot &amp; &quot;\\&quot; &amp; ax &amp; &quot;\\DisplayVersion&quot;, &quot;S&quot;) \r\n        If sVal = ProgName And sVer = ProgVer Then\r\n            sVal = REGReadValue(sKeYRoot &amp; &quot;\\&quot; &amp; ax &amp; &quot;\\UninstallString&quot;, &quot;S&quot;) \r\n            SH.Run sVal, , False : WScript.Quit(0)\r\n        End If\r\n    Next\r\nEnd If    \r\nWScript.Quit(0)\r\n\r\n'-----------------------------------------------------------------\r\nFunction REGEnumSubKeys(RegPath, byref AList)\r\n    Dim sKey, sTemp, A1, Dic, TS, s1, LB, LenP, Pt1, sName\r\n    On Error Resume Next\r\n    If Mid(RegPath, 4, 1) = &quot;\\&quot; Then \r\n        sKey = &quot;HKEY_USERS&quot; \r\n    Else \r\n        sKey = TranslateREGKey(Left(RegPath, 4)) \r\n    End If    \r\n    If (sKey = &quot;&quot;) Then \r\n        REGEnumSubKeys = -1 \r\n        Exit Function \r\n    End If    \r\n    sTemp = FSO.GetSpecialFolder(2) &amp; &quot;\\regk.reg.txt&quot;\r\n    If FSO.FileExists(sTemp) Then FSO.DeleteFile sTemp, True\r\n    sKey = sKey &amp; Right(RegPath, (Len(RegPath) - 4)) \r\n    LB = &quot;[&quot;\r\n    SH.Run &quot;REGEDIT \/E:A &quot;&quot;&quot; &amp; sTemp &amp; &quot;&quot;&quot; &quot; &amp; _\r\n           Chr(34) &amp; sKey &amp; Chr(34), , True  \r\n    If (FSO.FileExists(sTemp) = False) Then \r\n       REGEnumSubKeys = -2 \r\n       Exit Function \r\n    End If\r\n    LenP = Len(sKey) + 1 : sKey = LB &amp; sKey\r\n    Set Dic = CreateObject(&quot;Scripting.Dictionary&quot;) \r\n    Set TS = FSO.OpenTextFile(sTemp, 1)\r\n    Do While TS.AtEndOfStream = False\r\n        s1 = TS.readline\r\n        If (Left(s1, 1) = LB) Then\r\n            If (Left(s1, LenP) = sKey) Then  \r\n                Pt1 = InStr((LenP + 2), s1, &quot;\\&quot;) \r\n                If (Pt1 = 0) Then Pt1 = InStr(LenP, s1, &quot;]&quot;) \r\n                If Pt1 = 0 Then   \r\n                    REGEnumSubKeys = -3 \r\n                    Set Dic = Nothing \r\n                    Exit Function \r\n                End If\r\n                sName = Mid(s1, (LenP + 2), Pt1 - (LenP + 2))\r\n                If (sName &amp;lt;&amp;gt; &quot;&quot;) And (Dic.Exists(sName) = False) Then \r\n                   Dic.add sName, sName  \r\n                End If\r\n            End If \r\n        End If    \r\n    Loop     \r\n    TS.Close : Set TS = Nothing\r\n    If (Dic.Count &amp;gt; 0) Then AList = Dic.keys \r\n    FSO.DeleteFile sTemp, True\r\n    REGEnumSubKeys = Dic.Count \r\nEnd Function\r\n'-----------------------------------------------------------------\r\nFunction REGReadValue(RegPath, sType)\r\n    Dim r, i, i2, A1(), Ub\r\n    On Error Resume Next\r\n    Err.Clear : sType = GetType(RegPath)\r\n    If sType = &quot;E&quot; Then \r\n        REGReadValue = &quot;&quot; \r\n        Exit Function \r\n    End If\r\n    r = SH.RegRead(RegPath)  \r\n    Select Case sType  \r\n        Case &quot;S&quot;, &quot;N&quot; : REGReadValue = r\r\n        Case &quot;X&quot; : REGReadValue = SH.ExpandEnvironmentStrings(r)\r\n        Case &quot;BN&quot;, &quot;BS&quot;\r\n        Ub = UBound(r) : ReDim A1(Ub)\r\n        For i = 0 To UBound(r)\r\n            A1(i) = Hex(r(i))  \r\n        Next\r\n        REGReadValue = A1\r\n    End Select       \r\nEnd Function\r\n'-----------------------------------------------------------------\r\nFunction TranslateREGKey(sKeyIn)\r\n    Dim s1 : s1 = UCase(sKeyIn)\r\n    Select Case s1\r\n        Case &quot;HKCR&quot; : TranslateREGKey = &quot;HKEY_CLASSES_ROOT&quot;\r\n        Case &quot;HKCU&quot; : TranslateREGKey = &quot;HKEY_CURRENT_USER&quot;\r\n        Case &quot;HKLM&quot; : TranslateREGKey = &quot;HKEY_LOCAL_MACHINE&quot; \r\n        Case &quot;HKU&quot; : TranslateREGKey = &quot;HKEY_USERS&quot;\r\n        Case Else : TranslateREGKey = &quot;&quot;\r\n    End Select         \r\nEnd Function    \r\n'-----------------------------------------------------------------\r\n\r\n[\/code]<\/pre>\n<p>Download Source Code as ZIP (<a title=\"Uninstall Script Source Code (.VBS)\" href=\"http:\/\/www.roysac.com\/blogimages\/files\/UNINSTALL.ZIP\" target=\"_blank\">UNINSTALL.ZIP<\/a>)<\/p>\n<p>That&#8217;s it now. Enjoy and Cheers!<\/p>\n<p><a title=\"Roy of Superior Art Creations\" href=\"http:\/\/www.roysac.com\/\" target=\"_blank\">Carsten aka Roy\/SAC<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;Uninstall&#8221; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,30,3],"tags":[57,56],"class_list":["post-994","post","type-post","status-publish","format-standard","hentry","category-fonts-tool","category-tool","category-tools","tag-fonts","tag-tool-2"],"_links":{"self":[{"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts\/994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/comments?post=994"}],"version-history":[{"count":6,"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts\/994\/revisions"}],"predecessor-version":[{"id":1000,"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/posts\/994\/revisions\/1000"}],"wp:attachment":[{"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/media?parent=994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/categories?post=994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.roysac.com\/blog\/wp-json\/wp\/v2\/tags?post=994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}