VBScripts
Note: The script downloads take up multiple webpages. Script downloads and component downloads are
on separate pages. There is also a "table of contents" for download links and an index of download links.
This page has descriptions and download links for packages of scripts.
The script downloads "table of contents", as well as general scripting information, is here
The index of downloads is here
The download page for components is here
Sampler Pack - samplevbs.zip
This is a zip file containing a total of 18 VBScript files,
ranging from simple message boxes to multi-
function scripts that can write to the registry,
read/write text files, run programs, make shortcuts, etc. Each file has comments
at the top to explain what it does, and comments inline to explain operations.
Download samplevbs.zip - (11 KB) (Updated for Windows 10)
Text Ops - textvbs.zip
These are scripts to demonstrate the use of the Textstream object.
There are 4 scripts included:
• Find how many times a given word or phrase occurs in a text file.
• Replace instances of given text in a file.
• Process an html file, yielding a text file version with all tags removed.
• A very basic Textstream class block.
Download textvbs.zip - (6 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Files and Folders - filfol.zip
This pack has several scripts that deal with file and folder functions.
It contains samples of many of the FileSystemObject functions:
• Change attributes of a file.
• Remove all attributes, going down 4 folder levels.
(good for removing Read Only when files are copied from CDR)
• 2 scripts dealing with DateCreated and DateLastModified properties.
• Examples of working with Drive, Folder and File objects.
• Get special folder paths.
Download filfol.zip - (8 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
WScript.Shell - wshell.zip
This zip pack includes 8 scripts dealing with WScript.Shell:
• A demonstration of the many functions the Run command can perform.
• Getting the paths to Shell "special folders" (Win, System, Startup, etc)
• A script that uses 4 different methods to get 17 common folder paths.
• A demo of Sendkeys that opens Notepad, writes text and saves the file.
• Drag and Drop shortcut-making script.
• Simple demo of Popup message function.
• A script to manage multiple address books in Outlook Express.
• Change the title bar text on OE4.
(Last 2 use RegRead and RegWrite.)
Download wshell.zip - (7 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
IE-based Progress Bar - iebar.zip
This is a progress bar written as an inline class, or "class block".
The class can be pasted into any script to provide a progress bar derived from an IE window.
There are 2 nicer progress bars available in the component section below, but if you
don't want to use extra components the IE progress bar can serve fairly well.
The download includes 3 script demos and also demonstrates
using properties in classes. Once the class has been pasted at the end of your
script, the progress bar is created as an object and has several properties that can be
set, including icon, caption, back color, number of progress units, etc.
Download iebar.zip - (16 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Class Demo - ClassExtExe.zip
This pack includes a VBScript class with explanation and demo scripts. This is a class written
as an external file. The script also demonstrates drag-and-drop script functionality.
The ClsExtExe class includes 2 Registry functions:
1) Give it a file extension and it will return the full path of the default
program for opening that filetype.
2) Give it the name of a registered executable and it will find the full EXE path.
Download ClassExtExe.zip - (6 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Get-Let-Class Block - getlet.zip
This set of scripts demonstrates a class block. That is, a class
included into a VBScript that is used as though it were an external object. This class encapsulates text file
operations and shows the use of Get, Let and Err.Raise.
One of the demo. scripts is a Search-and-Replace utility that
uses the class to replace text when a file or folder is dropped on it.
Download getlet.zip - (7 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Desktop Pack - deskpack.zip
This is a pack of handy Drag-and-Drop scripts that can be left
on the Desktop. Some of these functions have been included in
other scripts. They're all together here with Drag-and-Drop functionality.
•
Change file attributes - drop a file on it to change any attributes.
•
Remove all attributes - drop any folder on it to remove file attributes
(such as Read-Only) down to the 4th folder level.
•
Character - Ascii translator (not Drag-and-Drop).
•
RegSvr script - drop a file on it to register or unregister a system file.
•
Tab remover - Ever copy and paste webpage text, then notice the
pasted text has wide tabs? This will remove them.
•
URL converter - converts deliberately obscured URLs to readable.
•
EXE2CAB - converts a self-executing CAB file (EXE) to CAB, using only Textstream.
•
CleanTEMP - Easily delete files from *all* TEMP folders.
•
DOCtoTXT - Convert DOC files to text. Handy to shrink and simplify all of those
attachments sent by people who don't know how to use Notepad.
•
Folder Sizes - Creates a listing of folder sizes, to help track down bloat.
•
Fix Returns - Fixes line returns in text files from Unix, MacOS, etc.
•
Base-64 - Drag-drop script to encode/decode to and from Base-64 using straight VBScript code (FSO).
•
Base-64 - Extremely fast drag-drop script to encode/decode to and from Base-64.
Uses ADODB and MSXML. Those should be available on virtually all windows systems.
•
Columnizer script - Converts a text file into 2, 3 or 4 columns.
Includes an option to choose how many lines are assigned
to a given column at a time. Demonstrates ReDim for arrays.
One limitation: Columns will only line up when using a monospaced font.
Download deskpack.zip - (27 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Shell.Application Ops - shellapp.zip
The Shell.Application object is not very well documented and is not officially
supported. It has some useful functions, but those functions are also undependable.
Since Microsoft does not support Shell.Application for Windows scripting they tend
to change and break things without notice, so that a set of functions that were already
rather funky -- created only for the now-defunct Active Desktop -- are also undependable.
The scripts in this pack demonstrate many
of the Shell.Application methods, but be sure to test code on target systems with this object.
Samples here include:
• BrowseForFolder folder browsing dialogue.
• Enumerate open folder windows, getting path and coordinates.
• Enumerate folder content by getting a ShellFolderView object from an open folder.
• Open folders and most of the items on the Start Menu (Run, Find, Shutdown, etc).
• Run any Control Panel Applet if you know the CPL file name.
Download shellapp.zip - (16 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Windows System Info - sysinfo.zip
This was originally a package of scripts for Windows 95/98. Most of those scripts have been
replaced with others.
• Running services - uses WMI to enumerate and describe currently running services.
• Hardware info - uses WMI to enumerate and describe installed hardware.
• IE Display info - Uses IE to get screen size and BPP info.
• WMI errors - A function that can be used to return descriptive information for WMI error codes.
Download sysinfo.zip - (10 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
EZPlanner 2 - Webpage Appointment Calendar
EZPlanner started out as a customized webview folder. Since Windows XP, WebView is
gone. And since Vista, Windows restrictions make these kinds of utilities difficult. EZPlanner 2
is an updated version that uses an HTA file. It's essentially a webpage that works as a
calendar program, composed of html and powered by VBScript. (The colors of the
calendar design can be easily changed. See notes near top of Calendar.hta file.)
View picture of EZPlanner 2.
Download ezplan2.zip - (7 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Thumbnail Viewer (and a drag-drop control)
The Thumbnail Viewer is an HTA that uses html and Windows Image Acquisition to display images
in a folder. Browse for a folder to display thumbnails of all BMP, JPG, TIF, PNG and GIF files in the folder,
showing file name and image size. Click a thumbnail to
show it enlarged. Click again to remove the enlarged image. Print the display of thumbnails.
There are also adjustable settings for thumbnail size and thumbs per row.
View picture of the Thumbnail Viewer.
View picture of the Thumbnail Viewer showing enlarged image.
Updated 8/2019 to support TIF and PNG files. Windows XP will require an update
of WIA support for this update. See help in program window for details.
Download tnviewer.zip - (43 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Class Pack
This is a collection of class blocks for pasting into scripts. As classes they act as creatable,
external objects. The variables and private functions of the class are not visible to the rest of the script,
so no editing of the main script code is necessary. Just paste the class block at the end of the
script to add complex functionality.
ClsReg Easy functions for reading Registry values: Check for the existence of a key or value,
check the data type of a value, or return formatted data along with datatype. Enumerate keys and
enumerate values by exporting a .REG file. Return 4-byte
binary values as decimal numbers.
CWMIReg The Class Pack also includes a copy of the
CWMIReg WMI Registry class
files and samples (next topic).
ClsReg was written to maximize the usefulness of standard
Windows Script Host Registry functions (WSH WScript.Shell), at a time when many PCs did not have
Windows Management Instrumentation (WMI) installed. The WSH functionality is limited and undependable.
The WMI functionality in general is slow, clunky and poorly designed. But the WMI Registry functions,
from the
StdRegProv class/object are at least fairly complete. The
CWMIReg wraps
the
StdRegProv functions in order to provide a set of simple and sensible Registry functions
that work well.
ClsColors returns 6-character hex values for common system colors.
ClsExt returns path of default program for a given file extension.
ClsPaths A compact class that uses a combination of 4 different methods
to return system folder paths - for current user or all users - on all Windows versions.
Browsing dialog classes and samples: FileOpen, ChooseColor and BrowseForFolder
that work on all Windows systems. The FileOpen and ChooseColor dialogs are achieved by using
the
htmlDlgHelper object -- an obscure and poorly documented object that is nevertheless
available on all Windows
systems. A related object,
htmlDlgSafeHelper, also provides an easy way to enumerate system fonts.
That code is included with the dialogs code. The FileOpen and ChooseColor dialog
methods here seem to be
the only such methods that will work on all Windows versions,
at all security levels, without using a 3rd-party component.
Download claspak.zip - (90 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
CWMIReg - WMI Registry Class
The Registry class in the Class Pack download (above) provides a convenient wrapper for
WScript.Shell functions. (RegRead, RegWrite, RegDelete.) But those functions are limited.
WScript.Shell cannot write long binary data or enumerate keys and values. WMI has the
StdRegProv object for full Registry access, but like most of WMI, StdRegProv is awkward and
poorly designed. This class combines the functionality of StdRegProv with the convenience
of WScript.Shell. Finally, it's full Registry access for scripting with simple functions:
Exists, Delete, CreateKey, SetValue, GetValue, EnumKeys, EnumVals. The only disadvantage
is that WMI must be installed and running, but that will not be an issue in most cases.
The download here includes a copy of the CWMIReg class, as well as sample scripts for
all functions and an html-based help file. The class can be pasted into your script or
loaded from a separate file using the
ExecuteGlobal function, which is demonstrated
in the sample scripts.
Download wmireg.zip - (18 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Recursion Scripts
Several scripts that will search a folder and all subfolders, creating a list
of all files with a given extension, all files modified since a given date, etc.
Download recurse.zip - (5 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Server Log Processing
This package includes scripts to return Hostname and location data from an IP address.
There are pre-written scripts to process webmasters' server logs in order to find out
more about who is visiting your website. These scripts can edit your log files so that
an entry looking like this:
100.100.100.100 -- [18/May/2012:00:02:46 -0400] "GET /jsware/js2.css....
ends up looking something like this:
srv1.somecompany.com*Toledo, OH, US -- [18/May/2012:00:02:46 -0400] "GET /jsware/js2.css....
This product includes GeoLite2 data created by MaxMind, available from
http://www.maxmind.com.
There are two different sets of scripts. One uses a Maxmind COM
DLL with database. The other uses Maxmind CSV data files to produce a script-only method.
Directions are in the download, but
you will also need the jsHTTP2
download. jsHTTP2 is used for Hostname resolution, while the Maxmind data is used for location
resolution. In other words, in the sample above, jsHTTP2 calls the server at the IP address to get
the first part, like
srv1.somecompany.com, while the Maxmind data is
used to get the second part, like
Toledo, OH, US.
Download logproc.zip - (60 KB) (Compatible with Windows 10)
Also see the MaxMind geo-location MSI database on the
MSI code page.
Go to Script Listings Page
Go to Scripts Index Page
MSI (Windows Installer) Utilities and Code
Windows Installer is a method of software installation, increasingly used by
Microsoft. It packages program installations into an MSI file that contains
a database holding all information about the installation. The idea, apparently, is
to have a single, dependable system of software installation that allows network
administrators to track installations more efficiently. The actuality is a remarkably
abstruse and superfluous complexity that leaves programmers and end-users alike
virtually unable to know or control how software is installed and what files
are included in a given program.
On the bright side, there is a fairly complete, script-accessible MSI automation interface -
the WindowsInstaller.Installer object. Script can access that object to unpack and edit
MSI installer files. Not only that...
Any MSI file can be used as an SQL database.
The MSI scripts now have their own webpage. There is an MSI unpacker utility (webpage program),
an MSI database editor (webpage program), a free MSI-based US zip code database (webpage program),
and a script for customizing installer files.
See the
MSI code page for all of that.
Go to Script Listings Page
Go to Scripts Index Page
IE MD - Internet Explorer Configuration Utility
The IE MD is a webpage program, comprised of several html pages and VBScripts.
It all comes packed with a script-based installer. The IE MD provides access to
numerous settings and information for Internet Explorer.
See the IE MD page.
Note: The IE-MD may not be fully compatible with IE7, though many of the functions/settings are still valid for IE11. There are no plans to update it.
See below.
Go to Script Listings Page
Go to Scripts Index Page
VBS Object Browser Utility -- Win32 only
This is a webpage-based object browser made using html and VBScript.
An object browser can read type library information to show you what
methods and properties are available from an object. This script-based version
works surprisingly well. It processed the entire IE DOM in MShtml.TLB
in just a few seconds without overloading WSH.
This utility works by taking advantage of the functions available in the Microsoft library
TLBINF32.DLL which installs with Office and Visual Studio. If you don't have
that file installed you'll need to get a copy of it.
There is also a very good help file for TLBINF32.DLL. You should be able
to get it at
this link.
View picture
Download obbro.zip - ( 20 KB)
Go to Script Listings Page
Go to Scripts Index Page
Binary Operations and Base64 Conversion with Textstream
This is a script class, ClsBin, that uses the Textstream object, combined with various string and
array functions, to carry out binary operations. It is generally thought that VBS does not handle
binary files (except through later versions of ADODB.Stream, which is not universally installed).
Actually, the Textstream can handle binary files just fine. It just needs some special treatment
to deal with "null" characters. In the Windows API, nulls [Chr(0)] are used to mark the end of
strings. As a result, while Textstream has no trouble reading or writing a string that contains nulls, the nulls
cause problems when you try to read text from the string or perform operations on it.
ClsBin provides a set of workarounds that make it possible to read and write file
bytes as both numbers and text, making it possible to perform any typical binary file operation.
Functions in the ClsBin class:
• Read and write binary files.
• Binary file helper functions, such as converting 4 bytes to a number.
• Convert to and from Base64.
• Get File Version Info. for PE files
(EXE, DLL, OCX. etc.) This is the info.
that shows on the Version tab of the file's Properties window, such as Description, CompanyName, etc.
A sample demo script uses the class to lighten a bitmap file image.
Download ClsBin package (tsbin.zip) - 52 KB (Compatible with Windows 10)
Notes about working with binary files
The JSBin.DLL component (see below) is an easier, more efficient
way to work with binary files, but the ClsBin class can do it without any extra components.
The JSBin.DLL download may also be of interest for more binary sample scripts if you
download this package.
Also of interest may be the
File Version Information Class and the
Icon Extractor
script (below). Despite the fact that VBScript cannot access the Windows API, all of these scripts demonstrate
ways in which VBS can often be used to bypass those same API functions. The File Version Info. class achieves
what normally requires a call to the API function
GetFileVersionInfo in VERSION.DLL. And the Icon
Extractor does the equivalent of calling the
ExtractIcon function from SHELL32.DLL. Both scripts work
by bypassing the level of the Windows API to operate at a lower level - the basic level of reading, writing
and manipulating bytes.
•
Note About DBCS (Asian) Languages With Respect to Textstream and Binary Files:
If you work with Asian-language systems there is a limitation that you need to be aware of,
regarding the use of the Textstream object to read and write binary files. DBCS (double byte character set) languages,
such as Chinese, Japanese and Korean, pose an extra challenge. One of the official Microsoft scripting experts, Eric Lippert, has
written about this issue in his "blog".
Unfortunately, if you have read that posting you may be left confused about how and
where Textstream binary operations will work. Mr. Lippert is somewhat forceful in asserting that Textstream
does not really work for binary functionality. But that is simply not true. As a result, his explanation of Textstream limitations is
a bit misleading and generally uninformative. The following explanation is an attempt to clear up any confusion.
The Textstream methods of
CreateTextFile and
OpenTextFile both have an optional
format parameter. If format is not specified then it defaults to ASCII. So Textstream is normally treating
all files as ASCII files, generally representing each byte as a character. If you look at
any file in a hex binary editor you will see the contents represented as a series of numeric byte values, from 0 to 255.
If that file is a plain text file then the bytes represent characters. For
example, in English the byte 84 is "T"
and 116 is "t". The ASCII system uses the "local codepage"
to define the character assignations for bytes. That means that a series of bytes in a text file will be
translated according to the default language on the local system. With most languages, each byte represents a
character and Textstream can be used to handle those bytes as binary data without a problem.
In the case of DBCS
languages, the 256 values possible in a byte are not sufficient to represent all
characters. That problem was dealt with by designating some bytes as escape characters in order to
increase the number of possible characters represented in ASCII text. In other words,
for example, a byte value of 51 might represent a particular character by itself, but represent a different character
if the 51 is preceded by, say, byte 88. That means that there is not always a one-to-one correspondence between
bytes and characters in DBCS languages.
With European languages this DBCS complication is not relevant.
However, if your computer's default language is set to Chinese, Korean, or Japanese - or if you want to send scripts to
someone with a PC defaulting to one of those languages - then in order to use the ClsBin class you would need to adapt the functions
to account for the escape characters of that language. (Probably you would need to use something like a
Select Case
when translating to/from characters/bytes in order to catch the special escape characters/bytes as the
data is being processed.)
Go to Script Listings Page
Go to Scripts Index Page
File Version Information Class
This is a class that can be pasted at the end of a script to provide file version information
functionality for PE files (EXE, DLL, OCX). Normally there is no VBScript method to return the information that shows
when a file is right-clicked, then "Properties" is clicked, and the "Version" tab is selected.
This class is condensed from the code in the Textstream Binary Ops scripts (above) to provide
a compact, pasteable class that returns
FileVersion,
CompanyName,
FileDescription, etc.
Download ClsProps package (filprops.zip) - 12 KB (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
The Running Process List - Win32 only
The running process list refers to all programs ("processes") running. That includes programs ("tasks")
that show in the Taskmon window when [CTRL+ALT+DEL] is pressed, and it also includes services.
This package was specifically designed for people who want to check for spyware, viruses, etc.
by investigating the software that is currently running on their computer. Having access to the list of
running processes is useful in guarding against undesirable software on your system because nearly all
such software runs in the background and is therefore in the list of running processes. Since "malware"
is usually set to run all of the time, it can be caught in the act. (But note that kernel rootkit software will not show
up in the process list.)
The download includes a script that details the running processes by using JSSys3.DLL (included). Also included
is an information html file that explains how to use the script.
Download ProcLister script (procs.zip) - 73 KB
Go to Script Listings Page
Go to Scripts Index Page
DOM-Editor: A script-based html editor
DOM-Editor is a "What-You-See-Is-What-You-Get" webpage editor made with
VBScript. It uses a webpage with 2 sub-frame pages to create a highly functional html editor
powered by VBScript, using only the IE Document Object Model (DOM) to accomplish
all the operations needed.
DOM-Editor is not meant to be a superlative
html editor. Rather, the idea is to provide sample code for various
IE DOM methods. The IE DOM is vast and it is difficult to find thorough documentation for it.
This editor provides a way to demonstrate many of the IE DOM methods, and also
serves to demonstrate the remarkable flexibility of the IE DOM.
Included methods: TextRange object operations, Body, Window and Document ops,
getAttribute, setAttribute, showModalDialogue, working with html Elements, etc.
View picture
Download DOM-Editor (domedit.zip) - 53 KB
Note: This script may be partially incompatible with later IE versions. Microsoft have gradually
broken various functions in the interest of security. The editor would need to be rewritten to work
with later IE versions.
Go to Script Listings Page
Go to Scripts Index Page
Icon Extractor
This is a set of scripts that extract icons from PE files (EXE, DLL, etc.) They're based on the
PE file functions used in the File Version Info. script (above). This script uses only
the Textstream object to read the resource table structure of a PE file and extract
the icon resources listed there. One script will extract icons of 9 different common sizes and
save them as ICO files. (Drop SHELL32.DLL onto this script to see what it can do!
It works surprisingly fast, even with files containing hundreds of icons.)
Another script extracts and reconstitutes
whole compound icon files. In many cases an icon file may contain multiple icons in
different sizes. The script recreates those files. Whether the .ico file
has 1 icon or 10 icons inside, each icon is extracted accordingly as it was stored in the
PE file resources. (The other script extracts all icon images, creates
file headers for them, and then writes them to disk individually.)
Download Icon Extractor (iconex.zip) - 32 KB (Compatible with Windows 10 for both 32- and 64-bit PE files.)
Go to Script Listings Page
Go to Scripts Index Page
Custom Message Box

This is a customizable message box made with Internet Explorer that
works in Win98 to Win8. It is a relatively small VBScript class that can be pasted at the
end of any script to provide a message box object with several custom options. It uses
the default system colors in an HTA (IE) window to produce a close facsimile of a system message box.
This message box is
self-sizing, with an option for using an icon image,
font choice, unlimited number of buttons, optional text input field, and optional dropdown
selector. It is very easy to use.
The 1-2014 update includes a new class, adapted from the msgbox class,
that provides an
output window, allowing a script to send text to a message window
during script execution. (Sample script included.)
Download Custom Message Box Class (msgb.zip) - 79 KB (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
XPFix - Various VBS/WMI Utilities for Windows XP
...Fixing services bloat, folder dysfunction, and various other XP problems...
These utilities have their own separate webpage. There are currently two downloads,
which both involve HTA webpage programs using VBS and WMI:
XPFix - A general tweak/fix utility for Windows XP that uses VBS and WMI. The idea
with XPFix is to provide a quick way to fix some
of the problems on a default XP install, and add back some of the useful things that are missing from XP.
XPFix provides an easy, informative interface to disable numerous risky XP services. It also provides
a few simple tweaks to make XP more usable. They include disabling
many of the "babysitting" and nagging functions, as well as adding such handy features as right-click
"Open with Notepad" and right-click "Open in New Window" (for folders).
XP Folder Fix - Ever notice how Windows folder size and view preferences never seem
to stick? It's been like that since Windows 95! Folder windows are one of the most basic points of interaction for people
who use Windows, yet Microsoft has never provided a simple, sensible way to dependably choose size, position, type
of display, etc. for folder windows. It's a prime example of the basic problem with Microsoft products: If Microsoft
were selling cars, you wouldn't be able to drive the MS Roadster to NYC. Why? Because NYC is not a safe place to
go and you're not capable of deciding that issue for yourself. So that functionality has to be hidden away where only
brazen, determined and reckless "tweakers" will find it.
In Windows 95/98/2000/ME, folder window size can be controlled with just
a couple of lines of script in the folder.htt file that controls "WebView" folders. It's an obscure
tweak, but an easy one. With Windows XP, Microsoft removed the WebView functionality
and folder view control has degenerated into a bizarre, nonsensical tangle of Registry keys.
The new system is not only an overkill of complexity (as usual) but it's also just plain broken.
Under normal circumstances Windows Explorer records settings for all folders ever opened -- then
ignores them!
XP Folder Fix consists of an HTA program that allows you to select size and view
for
all previously opened folders.
Go to Script Listings Page
Go to Scripts Index Page
Retrieving/Removing JPG File Info. - Exif, IPTC, Thumbnail, Summary
JPG files have file header specifications that provide the option to store various
data in the file. These scripts use only FSO and Textstream to extract 4 types of
JPG data. The basic code includes 3 classes that present JPG file data through
two custom objects. The total code is only about 30 KB, so it can be pasted whole into
other scripts to add JPG header parsing functionality. (Note that not all JPG files have all types of data stored, and this script can only
retrieve, not save, such data.)
Exif tags - extract data stored by digital cameras that describes the camera and settings used to take a photo.
Summary properties - extract five comment strings that can be saved/viewed on Windows XP in a file's Properties window -> Summary tab.
Thumbnail - extract a thumbnail version of the image, which most digital cameras store in the file header.
IPTC strings - extract IPTC data such as photographer name, location of shot, etc.
The 9/2012 update expands the ability to extract thumbnails. Nearly all embedded thumbnails
are JPG files, but other types of thumbnails are possible. This update adds the ability to extract "uncompressed RGB"
thumbnails, which may be deployed in rare cases by some digital cameras.
The 9/2012 update also adds two scripts for removing all EXIF data from JPG files.
Download jpginfo.zip - (35 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Sudoku Solver
Would you like to impress a potential employer or lover with your sudoku expertise?
Perhaps a loved one has succumbed to the sudoku craze, convinced it will somehow
make them more intelligent, and you want to thwart them by filling in their entire sudoku puzzle
book "for their own good"? Then Sudoku Solver is what you need. This is an HTA program
that shows a sudoku grid, allows you to enter the pre-existing puzzle numbers, then solves the
puzzle. It may have limited uses, but it's somewhat interesting in terms of the scripting
challenge. It turns out that the code for this is not terribly complex.
Download sudoer.zip - (13 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Sorting Demo
Sorting here refers to alphabetical (or numeric) sorting of array elements. VBScript can
sort an array of words alphabetically with surprising speed. Using the scripts in this download, a
QuickSort routine sorted 70,000+ words in under 3 seconds. (Running on Win98SE with Sempron 1800 Mhz.)
More typical sorts are virtually
instant. QuickSort is also a very simple routine. Yet there is a lot of advice online to the
contrary. Even "The Scripting Guys", who are the official Microsoft VBScript experts, suggest
the abominable
BubbleSort
or even worse,
a .Net method!
BubbleSort is so bad that we didn't even test it on larger arrays. In cases where QuickSort took less than 1
second, BubbleSort still hadn't returned after a matter of minutes. And using .Net these days requires installing
a runtime dependency of over 200 MB. QuickSort only requires a sub of about 20 lines.
The download here includes an explanation of the tests, scripts to test 5 sorting methods,
and 3 versions of QuickSort. (For case-sensitive, non-case-sensitive, and 2-dimensional array sorting.)
Download sorting.zip - (7 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
CodeLib - Code Sample Database
CodeLib is an HTA program (the visible part) combined with an MSI file (the database part).
It's a flexible, searchable database wherein one can store code samples for script, programming code,
html, CSS, or anything else. Choose a language and CodeLib loads a list of stored sample names.
Click a sample name to load keywords, description and the actual code sample itself. The database
can also store files, such as type libraries, ActiveX controls, etc.
CodeLib is a simple, orderly way to catalogue your favorite scripts and snippets.
It also provides a way for people to share code libraries between themselves.
View a screenshot of CodeLib
Download codelib.zip - (96 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
HXS Converter - (Convert "Help 2" into html Help or webpages)
HXS is "html Help 2" format. Most Microsoft documentation now comes as HXS files. Microsoft has
not released a standalone reader for HXS files. But HXS can be converted to CHM. See the
HXS to CHM page for further explanation and download.
Go to Script Listings Page
Go to Scripts Index Page
Text-To-Speech Using SAPI
SAPI is the Microsoft Speech API. SAPI 5 ships with Windows XP+, and can be installed on
earlier Windows versions. SAPI 5 provides an object
spVoice that is scriptable and is
very simple to use. This download includes an HTA utility that will speak text. It has controls
for volume, speed and voice selection. The HTA code provides samples of the useful properties
and methods available from spVoice.
Also included is a surprisingly simple script to record text. Drop any
text file onto the script and it will create a WAV file of that text being spoken.
Download sapitts.zip - (7 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Enumerating Processes with WMI
Enumerating open windows is not fully possible with VBScript alone,
without using 3rd-party software that can provide access to the Windows API.
WMI provides a poor man's approach: WMI does not recognize the Windows shell
so it can't enumerate windows and list their title text, but it can enumerate processes.
The scripts here show how to list running processes, close a running program,
or set focus to a program using the WMI Win32_Process object.
Download wmiprocs.zip - (4 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
PE Ops
A PE file (portable executable) is an executable file, such as EXE, DLL, or OCX.
PE files have an extensive, complex file structure that can store a great deal of data and
resources. There are two packages of PE parsing scripts here:
1) Import/Export List: Get a list of exported functions, imported libraries (dependencies) and imported functions
for a PE file. The list is compiled by parsing the PE file headers and tables directly.
Download peops.zip - (34 KB) (Updated for Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
JSON Parser Class
JSON is a data storage format, something like an INI file, but far
more involved to parse. It's similar to INI in that it's essentially strings stored as
name:value pairs.
JSON is structured similarly to javascript and called
JavaScript Object Notation.
It's ugly and poorly designed, but there's sort of a reason for that: Modern
browsers have a JSON object available in browser javascript that can present
JSON text as a javascript object model using the JSON
Parse method.
The ability to access JSON as an object model has pros and cons. On the good
side, it works. On the bad side, that feature has required JSON to be as poorly
designed and unreadable as javascript itself, yet with limited value. Using
the object model gets tricky with complex JSON, and requires visually dissecting
the structure in order to make it work. And, of course, the object model approach
only works within a webpage with script enabled. The functionality is part of browser scripting engines.
The superfluous quotes, the brackets, the curly brackets, the extreme nesting....
those obstacles are all necessary so that browsers can interpret JSON as javascript.
This download takes a different approach. It's a VBS class for parsing
JSON and retrieving specific data. There is also a formatter utility included. If you look online for
tools to format JSON for readability ("prettify") you'll find lots of webpages stuffed with
bloated junk like jquery. But actually, formatting is built into the javascript runtime for
modern-ish browsers. It only requires one line of code:
T1.value = JSON.stringify(JSON.parse(T1.value), null, 4);
(Where T1 is the ID of a TEXTAREA.)
Along with the formatter are javascript examples of how one
would access JSON data using the javascript object model approach.
Download json.zip - (62 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Javascript De-obfuscator Utility

This is an HTA utility. It shows a text window to paste javascript code and then
displays a cleaned-up, deobfuscated and color syntax highlighted version below. The image
to the right shows a small sample. There is also a simpler, VBS drag-drop version: Drop a javascript
file onto the VBS file and it generates an html file to display the code with formatting and syntax color highlighting.
Increasingly, webpages are being created with large amounts of
javascript. In many cases the script is deliberately obfuscated: written in the
worst way possible in order to hide its functionality. The Javascript De-obfuscator Utility
decodes URL encoding, adds color syntax highlighting, adds formatting and line returns,
and generally clean things up to maximize readability.
There are limits to how well webpage coding can be cleaned up. When
variable names are deliberately stripped down to meaningless letters and everything
possible is done to avoid clarity, nothing can be done to fix that. But this tool at
least helps.
Download jsdeob.zip - (25 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Windows Image Acquisition (WIA) Graphics Functions and Scanning Utility

This is an HTA Image Editor powered by a VBS class. WIA has a number of image
editing functions that could be very useful to scripters. There are
functions to resize, rotate, crop and convert between 5 file formats. There is also a way to get/set
image pixels as numeric RGB values. The flower pictures here are samples of that functionality, using
nothing more than VBScript in an HTA.
Unfortunately, WIA is very poorly designed. The object model is strange and non-intuitive.
It breaks with both COM and Win32 API tradition.
Some of the functions that should work with script don't. Some of the functions that do work
are problematic. For example, when WIA is used to do operations like resizing and rotating it
saves the changes to disk, as a TEMP file, with each operation. If the image is then saved,
WIA saves the TEMP file. That means that if you open a JPG, perform a few operations, then
save it, you'll find that your JPG is badly marred by artifacts because WIA resaved it as JPG with each
operation, losing image data with each save! The sheer stupidity of such a design is difficult to
fathom.
There are a number of such "gotchas" with WIA. But it still has some useful functionality,
and most of the gotchas can be avoided.
The download here includes the HTA image editor program powered by a VBS class that wraps the WIA
mess, making it easy to use and sidestepping the problems. The class can also be used separately for such things as batch
image editing. It's designed to encapsulate the WIA methods so that one never has to deal with them directly.
In turn it exposes a set of simple, intuitive methods: OpenFile, SaveFile as BMP/GIF/JPG/TIF/PNG, CloseFile,
Crop, Rotate, Resize, Mirror, Bevel, Border and Sharpen.
(The three images here demonstrate Bevel, Border and saving PNG with transparency.)
Scanner Interface: The WIA Editor also incorporates a scanning tool.
One function of WIA is to serve as an interface for scanners. It's an option other than TWAIN. If a scanner
has WIA support, this utility can be used to import images from it. WIA is not supported by all scanners, but
is generally supported by newer scanners. The WIA Editor won't provide more functionality than is available
from a printer's native software, but may be useful to simplify imports or in cases where scanner utilities will not
install on a particular Windows version. The details are provided in the Editor help, available
in the editor window.

WIA support is pre-installed on Windows 7+. XP needs the file
wiaaut.dll. There are notes about that in the download.
View picture of WIA Image Editor HTA
View picture of WIA Image Editor Scanning Tool
Download wiaed.zip - (25 KB) (Compatible with Windows 10)
Go to Script Listings Page
Go to Scripts Index Page
Auto Loan Calculator
This is a very simple HTA. The code to calculate auto loan rates is
hardly more than 1 line. But it's handy to have.
Download loancalc.zip - (1 KB) (Compatible with Windows 10)
Firefox Bookmarks Webpage

This is a script that will create a webpage from Firefox bookmarks. In Firefox, Pale Moon, or
other Mozilla-type browsers, bookmarks can be exported to a webpage of sorts, but that webpage is poorly
laid out and composed of faulty html. This script creates a cleaner
webpage from that export, using CSS to mimic the behavior of collapsing and expanding folders. Just
drop the exported bookmarks.html onto the script to produce a better webpage.
Download FFlinks.zip - (36 KB)
UTF-8 to ANSI conversion
The scripts here can be used to convert UTF-8 text to
ANSI (windows-1252) encoding. For a full explanation of
ASCII, ANSI, UTF-8 and 16-bit unicode encoding, see the
readme file in the download.
In brief, UTF-8 encoding is the standard for webpages
with html 5. But in some cases it may not display properly,
showing odd characters like a capital A with a caret on top.
For anyone who works with common, western European
languages, UTF-8 is generally not necessary. The necessary
characters can all be displayed in the standard ANSI 1-byte-
per-character format. Thus, it may be helpful to convert
UTF-8 files to ANSI.
There are three files here. One uses only VBScript to
convert common characters that correspond to ANSI
characters, such as Euro sign, copyright and curly quotes.
That conversion is sufficient for most European-language
files.
The second script converts UTF-8 to 16-bit unicode
using VBScript, then converts that to ANSI using the
Textstream object. That method is especially good for
foreign languages with characters not included in the
ANSI windows-1252 character set because it will make an "intelligent"
conversion. For example, the Sanskrit "s" with an accent
is not converted to "?" but rather to simply "s", effectively
producing an anglicization of foreign words.
The third script is for converting UTF-8 webpages
to ANSI text. It uses IE and ADODB.Stream to make a conversion
similar to the second script, resulting in a high quality conversion.
Download u2a.zip - (7 KB) (Compatible with Windows 10)
Email Base - MSI Database for Outlook Express, Thunderbird, or Other Email Programs
This is an HTA program that uses MSI database files to store and organize email.
It can store any email added as single files, such as EML files. For OE there is a program named undbx that
can extract DBX files to EML files. The download here includes a script that can do the same for
Thunderbird storage files.
Email Base is not for everyone. If you use only GMail webmail and trust Google
to store your backup then you won't need this. But if you have old email that you want to
back up, access and be able to search easily, Email Base might be handy.
Any number of MSI files may be filled with 5,000+ emails each. For example,
you might want an MSI for each inbox and another for Sent email. An MSI can then be loaded
into Email Base to access, search, read, or save attachments from any of those emails.
View Screenshot
Download ebase.zip - (148 KB) (Compatible with Windows 10)
Social Security Calculator
Are you American? Between 60 and 66 years old? Collecting Social Security or
thinking about it? If so, this tool might be useful. If you're over 66 then collecting SS is
straightforward. If you're under 66 it's a different story. When you turn 62 you can start to collect SS,
but until you reach 66-ish
(official retirement age) the benefits are limited. You collect less per month, lose some of
it if you make too much other income, and some of it may be subject to tax. It can be challenging to
figure out whether it makes sense to start collecting.
If you make $50K/year there may be no benefit at all in collecting SS before 66.
(But also no penalty. Whatever money you earn goes toward your benefits, even if
you're already collecting.) If you make $40K/year and want to collect, you might do better making
only $30K. The reason for that is because you forfeit SS income and pay more tax as your income
goes up. For instance, if you're self-employed you pay 15.2% off the top for SS tax, but SS payments are
not subject to SS tax. It gets complicated.
This download is an HTA utility powered by VBScript. You enter expected
net income and SS payments that you qualify for, and the utility calculates what your
actual
annual income would be once the dust settles. It also takes into account the Republican tax
cut for the wealthy of 12/2017. (In a nutshell, if you're self-employed, then the more money you
make, the more money that tax cut will give you. At lower income levels the effect is not
significant.)
The calculations are automatically written to a chart in an html
file each time a calculation is done. So you can compare options and see what your
real income would be collecting SS benefits under age 66 while still working. How much would you
actually "take home" if you earn $10K $20K? $30K? $40K? (If you expect to earn $60K or higher
there's probably no reason to consider SS until you reach 66.)
Download sscalc.zip - (8 KB)
Data URI Code Creator
A data URI, in this case, refers to embedding images directly into html as
base64-encoded text. Like an office document that includes images as part of the file,
all modern browsers will recognize an embedded image in html. That means you can write
portable webpages that include the html, CSS and all images in a single html (text) file.
With the exception of IE8, which limits embedded images to 32 KB, any image that might be
used online will work. (Some browsers may limit images to 2 MB.)
This download includes a sample webpage and 2 small scripts. Drop
an image onto one script and it generates the finished IMG tag, putting it on the
Clipboard for pasting. Drop an image onto the other script and you get CSS for a
background-image property.
Download datauri.zip - (113 KB) (Compatible with Windows 10)
Youtube-dl Helper Utility
This is an HTA utility (runs in an IE window) that makes youtube-dl easier to use.
Youtube-dl is a very capable, free, open-source utility that can download audio and video files from
Youtube, Vimeo and many other sources. Unfortunately, youtube-dl is command-line only and
can be very confusing to use. Youtube-dl Helper provides a graphical interface for youtube-dl.
Just tell it where youtube-dl.exe is and select a destination folder for downloads. Then simply
paste in URLs for videos. Youtube-dl Helper does the rest and presents a report when the operation
is finished.
No muss, no fuss, and no typing in DOS console windows like it was 1985.
Download ytdl-helper.zip - (8 KB)
Video/Audio Metadata Editor
This is an HTA utility (runs in an IE window) for editing metadata tags in media
files such as MP4, MP3 and FLV. The editor is a "frontend" for ffmpeg.exe. Ffmpeg must be downloaded.
There are links in the help file in the download, for both Win32/XP and Win64. This utility allows you
to load a file, change up to 9 tags, such as title, artist, comment, etc, and save them back to the
file. It saves the tedium and complications of using command line operations and can edit up to
9 tags at once.
View image of Metadata Editor
Download mded.zip - (13 KB)