Posts

Building Small Utilities with Visual Basic 6

A practical look at Visual Basic 6 for quick Windows utilities, internal tools, and desktop helpers before the .NET era.
Table of Contents

Most useful software in a small office is not a big platform. It is a tiny internal tool that removes one repeated pain: renaming files, collecting form data, creating a daily folder tree, or checking whether a service is alive.

In 2004, Visual Basic 6 is still one of the fastest ways to build that kind of utility on Windows 2000/XP.

Where VB6 Still Wins

If the job needs a GUI and needs to ship quickly, VB6 remains hard to beat:

  • Design a form in minutes
  • Put validation near each input
  • Call COM components already used in your office
  • Build an .exe that non-technical users can click

That matters when your users are accountants, editors, or support staff and not script-friendly admins.

Typical Utilities Worth Building

Good VB6 projects are small and specific:

  1. Intake forms that write CSV or Access records
  2. Folder and file helpers for repetitive naming rules
  3. Printer-label or barcode helpers tied to an internal list
  4. Simple launcher tools for multi-step workflows

You get the most value when the app has one clear purpose and one obvious screen.

Example: Daily Folder + Notes Starter

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
Private Sub cmdStart_Click()
    Dim workRoot As String
    Dim todayFolder As String

    workRoot = "C:\Work"
    todayFolder = workRoot & "\" & Format(Date, "yyyy-mm-dd")

    If Dir(workRoot, vbDirectory) = "" Then MkDir workRoot
    If Dir(todayFolder, vbDirectory) = "" Then MkDir todayFolder

    Open todayFolder & "\notes.txt" For Append As #1
    Print #1, "Session started: " & Now
    Close #1

    Shell "notepad.exe " & Chr$(34) & todayFolder & "\notes.txt" & Chr$(34), vbNormalFocus
    lblStatus.Caption = "Ready: " & todayFolder
End Sub

This is not architecture theater. It saves a few minutes every day and prevents inconsistency. That is enough reason to ship it.

Practical Deployment Lessons

The part many tutorials skip is deployment:

  • Keep the machine on VB6 SP6 runtime
  • Document OCX dependencies (MSCOMCTL.OCX issues still happen)
  • Avoid obscure third-party controls unless you must
  • Use a simple installer (Inno Setup or NSIS) and version your build

If your utility only runs on your own machine, it is a demo. If it survives one clean install on another PC, it becomes a tool.

VB6 vs .NET in Real Offices

Yes, VB .NET and C# are getting attention. But many shops still have:

  • Older hardware with 256-512 MB RAM
  • Existing COM components
  • Staff familiar with classic VB syntax

For internal tools with short lifetimes, VB6 often delivers faster than a full platform migration.

Calling Windows APIs Without Overbuilding

VB6 can reach past the standard controls when you need to:

1
2
3
4
5
Private Declare Function GetTickCount Lib "kernel32" () As Long

Private Sub cmdUptime_Click()
    lblStatus.Caption = "Tick count: " & GetTickCount()
End Sub

You do not need C++ for every task. A few Declare statements cover many file, registry, and process operations. Keep API use localized — one module, documented — so the next person knows which external calls exist.

VB6 vs Batch and AutoIt

Batch files handle log copying and scheduled jobs with zero runtime install. AutoIt handles GUI automation when installers lack silent flags. VB6 wins when non-technical staff need a form, validation, and a button that always looks the same.

Pick the smallest tool that fits. Not every problem deserves a compiled utility.

A Real Support Scenario

A print shop needed daily job folders named by date and client code. A twenty-line VB6 form replaced a manual rename ritual that failed every Friday when someone used the wrong date format. Total build time: one afternoon. Total maintenance in six months: one path change in an INI file.

That is the VB6 sweet spot — narrow pain, fast delivery, stable enough to forget about until requirements change.

Guardrails That Keep Tools Maintainable

  1. Keep configuration in INI/text files, not hardcoded paths
  2. Validate input before any file or database write
  3. Show user-friendly errors, log technical details separately
  4. Keep one executable per workflow, not one mega-utility
  5. Add a tiny About dialog with version/build date

The Rule for Small Tools

In 2004, VB6 is still a practical desktop workhorse for small utility software. The best VB6 utilities are not ambitious; they are reliable, boring, and easy to hand to the next person.

Build the narrow tool. Ship it cleanly. Improve it only when real users hit a real limit.