r/visualbasic • u/Sea_Priority_4174 • 6d ago
Is there still a use case for debugging VBScript in legacy Windows applications?
Hi everyone!
Recently, I've been researching ways to debug VBScript running inside third-party Windows applications, especially applications that embed their own scripting engines and expose internal COM objects to scripts, but DO NOT expose those objects as externally accessible COM interfaces.
This creates an interesting challenge: you can write and execute scripts within the application, but debugging them with external tools like cscript.exe or a regular VBScript debugger isn't straightforward, because the scripts depend on the application's internal runtime and object model.
I've been experimenting with this problem and recently managed to get debugging working with Altium Designer DXP 2004, an older PCB design application.
Here's a short demonstration video.
I'm also working on a VS Code extension to make VBScript development more convenient, including debugging, code completion, and COM object exploration.
However, I'm curious about the current state of VBScript development:
Are people still writing VBScript for legacy Windows applications?
Do you still encounter applications that embed VBScript but don't provide a proper debugging experience?
Are there other applications with similar scripting environments and internal COM object models?
Is building better debugging tools for VBScript still worthwhile in 2026, or has this become too niche of a use case?
I'd particularly like to hear from people who maintain legacy automation scripts or work with COM-based Windows applications.
I'm interested in hearing about your experiences and whether you think this is still a problem worth solving.
Thanks!
1
u/FuggaDucker 6d ago
I don't understand "for legacy Windows applications?" Its an app or it isn't.
What application provides a 'debugging experience' for it's internal technologies?
The Windows Script Host has always had a full featured debugger for VBScript and JScript.
Visual Studio 2022 supports it out of the box while it is broken in VS2026 listed as an open item.
1
u/Sea_Priority_4174 6d ago
You're right, the Windows Script Host has had debugging support for a long time.
However, my use case is a bit different. I'm not trying to debug standalone VBS files running under WSH.
For example, Altium Designer has its own embedded scripting environment and exposes objects like
PCBServerto its scripts. These objects are provided by the host application and aren't available when running the same script throughcscript.exeorwscript.exe.So the challenge isn't debugging VBScript itself, but debugging VBScript while it runs inside another application's runtime, with access to that application's internal object model.
1
u/FuggaDucker 5d ago
Yeah.. thanks for 'splaining your use case. Very interesting. :)
I should have read your post better.Since you've already manged to debug VBScript inside Altium, have you explored using IDispatch and ITypeInfo to look at the apps internal COM objects?
I'm would be interested in whether your extension can discover undocumented methods and properties at runtime, rather than relying on existing type libraries or documentation.
2
u/decimalturn 6d ago
Wow, this looks great! Do you think some of this work could allow to implement debugging VBA code running in Excel for instance? I know the VBA DLL and `cscript.exe` aren't wired the same, so probably not, but maybe.
1
u/VerioSphere 6d ago
msft was talking about deprecating vbscript. But I think they deferred that. However, they already made vbs generally unsupported in edge. It is also not part of any .net web platform.
We have a VBS to JavaScript translator and we have used that for some rare ASP applications that had client side VBS. That was also while rewriting the server -side VBS to C#. We rarely rarely see prospects using vbs.
A VBS debugger would be helpful in analyzing the precise behavior of VBS code for the purpose of rewriting it to a supported platform, but again, niche use case.
1
u/Mayayana 6d ago
I think VBS has always been unsupported in Edge, but it's supported in HTAs, which are still there. There are probably a large number of HTAs in use in business, so they can't feasibly dump that. That's really the point with VBS and VB6, too. They can be used for new software but the main point is custom business software and utilities that are still in use.
IE is alive and well under the hood. And openly if one wants that. I remove Edge from all Win10/11 and have IE as my default web browser. (Who in their right mind would use Chrome with extra spyware? Only some of the people who, when you ask them what browser they're using, answer, "Windows?") Then I block IE in my firewall. So nothing can try to jump online without asking.
VBS is long gone for Web, but still very handy for Windows utilities. PowerShell can do some impressive things, but the design is a mess and it's not well suited to process-oriented coding. It's all about commandline. MS were trying to make Linux admins feel at home.
I think the real point is not so much VBS or JS per se but rather COM. MS provides a dispatch COM interface for nearly every technology they produce. So anything that can handle that can do a lot of things.
4
u/Mayayana 6d ago
I've worked with both VBS and VB6 for many years. I started with VBS. Today I still use VBS regularly, for various tasks that require repetition, like changing a word in 20 files. I have maybe 20 scripts on my Desktop, from converting centigrade to fahrenheit, to encoding/decoding base64.
If I need something simple I write a script. If I want a more complex utility that doesn't need VB6, I write an HTA. I also have a lot of them on my desktop. In fact, lately it seems that the only thing I have that can talk to my scanner is a graphic editor HTA that I made based on WIA. :)
I even have a VBS-powered HTA that uses MSI files as searchable databases for my old email. (MSIs are very stable, fast, adaptable databases with support on all Windows systems.)
But VBS embedded in software? I've never done it. I've never had a program that did it. You're talking about using the script control? That always seemed like a daffy idea to me.