SATURDAY, OCTOBER 10, 2026|No. 18128
Windows · Technology

Understanding the Obscure winstart.bat File in Windows Startup

The winstart.bat file, a little-known component of Windows startup, executed specific batch commands before the main Windows environment initialized, offering a distinct use case from autoexec.bat.

A vintage computer screen displaying a command prompt interface.
A vintage computer screen displaying a command prompt interface. · Photo by Dan Counsell on Unsplash
1 sources
Pipeline ingest
3 reads
Positive / Neutral / Negative
0 countries
Related coverage

Reader Otul Osan wants to know what the use case for C:\WINDOWS\WINSTART.BAT was, compared to C:\AUTOEXEC.BAT and when exactly during system startup it launches.

In Windows 95, you could create a winstart.bat file in your Windows directory. During startup, the virtual machine manager initializes and creates the so-called “System virtual machine” (the “System VM”), which is the virtual machine that all Windows programs run in. But before running the user-mode kernel in that virtual machine, the virtual machine manager runs the winstart.bat batch file if it exists.

In pictures: First, we boot up MS-DOS and the command prompt.

Stuff(unused)MS-DOS

The box labeled “Stuff” is a catch-all for random things that go at low addresses, like the interrupt vector table and the BIOS data area.

Next, command.com runs autoexec.bat, which might install some TSRs.

StuffTSR1(unused)MS-DOS

And then Windows starts up and initializes the virtual machine manager. The system is now running in protected mode with a virtual machine running in v86 mode, and that virtual machine is initialized with whatever was running in real mode at the time the virtual machine manager took over.¹

v86 modeStuffTSR1(unused)MS-DOS

I crossed out MS-DOS because the virtual machine manager took over responsibility for the file system and shut off the real-mode file system in MS-DOS.

At this point, the virtual machine manager runs winstart.bat inside the virtual machine, and maybe it installs another TSR.

v86 modeStuffTSR1TSR2(unused)MS-DOS

And then we start the user-mode kernel that is in charge of Windows applications. That user-mode kernel switches the virtual machine into protected mode and starts running what most people think of as Windows.

v86 modeStuffTSR1TSR2MS-DOS
prot mode(ring 3)GUI stuffring 0: virtual machine manager

And then from the Windows GUI, you decide to open a command prompt, which means creating a second virtual machine.

v86 modeStuffTSR1TSR2MS-DOS
prot mode(ring 3)GUI stuffring 0: virtual machine manager
---------------
v86 modeStuffTSR1COMMAND.COMMS-DOS

Notice that the virtual machine running command.com is a copy of the system when Windows started.² So it has TSR1 (from autoexec.bat) but not TSR2 (from winstart.bat).

If you install a TSR in the command prompt virtual machine, you get

v86 modeStuffTSR1TSR2MS-DOS
prot mode(ring 3)GUI stuffring 0: virtual machine manager
------------------
v86 modeStuffTSR1TSR3COMMAND.COMMS-DOS

Okay, now that we see how the pieces fit together, we can reverse-engineer the purpose of winstart.bat.

The intended purpose of winstart.bat is batch file is to allow you to install TSRs that will apply only to Windows programs. For example, you might install network drivers to support your Windows programs. You might choose this option instead of installing them globally because you don’t care about networking for your MS-DOS programs and want to free up conventional memory for them. Or because those drivers don’t support running in multiple virtual machines, so you’ll take them in the System VM and forego them for your MS-DOS programs.

What I find interesting is that most people who discover this say that it’s a feature of Windows 95. But really, it’s a feature of Windows 3.1 (and possibly even Windows 3.0). You can find it documented in the Windows 3.1 Resource Kit on page 263. That page even has a nice table showing three ways of launching TSRs and how they are visible in the different virtual machines. (In this table, “TSR visible in virtual machines” really means “TSR visible in non-Windows virtual machines”, but the documentation takes the convention that the term “virtual machine” refers only to non-Windows virtual machines and not to the virtual machine running Windows itself, which it simply calls “Windows”.)

Where TSR is loadedTSR visible in Windows?TSR visible in virtual machines?
From MS-DOSYesYes, all virtual machines
From WINSTART.BATYesNo
In a single virtual machineNoOnly that virtual machine

¹ Think about that: We booted an operating system and then booted another operating system around it, so that the original operating system was now running inside a virtual machine controlled by the second operating system. It’s like leaving your house, walking down the street, and halfway down the block, realizing that you’re now walking inside a movie studio set.

² It isn’t actually a copy of the system at the time Windows started. Rather, it is a copy of the system VM, but only the parts that existed at the time Windows started. How this worked is too complex to try to explain in a footnote. Maybe I’ll discuss it some other time.

Category

Topics

Share

Author

Raymond Chen

Raymond Chen

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

5 comments

Join the discussion.

Leave a commentCancel reply

Sign in

Code of Conduct

Sort by :

Newest

I don't recall how I discovered this, but years ago I used winstart.bat in a commercial Windows 3-era app I built. The app allowed administrators to lock down Windows PCs so users couldn't blow up the configurations. I used winstart to load a headless DOS executable that would quickly check to see if our retainer had been paid. If we were paid, the app exited. If we hadn’t been paid, it generated a random number, and if that number was, say, a 9, it would execute a tight perpetual loop and lock-up the machine. This caused the PC to appear...

Read more

I don’t recall how I discovered this, but years ago I used winstart.bat in a commercial Windows 3-era app I built. The app allowed administrators to lock down Windows PCs so users couldn’t blow up the configurations. I used winstart to load a headless DOS executable that would quickly check to see if our retainer had been paid. If we were paid, the app exited. If we hadn’t been paid, it generated a random number, and if that number was, say, a 9, it would execute a tight perpetual loop and lock-up the machine. This caused the PC to appear to have a problem. The thinking was that the client would call us to troubleshoot the computer, and we would require payment of any delinquency before we would render service. Only one client was ever impacted by the app. We had a spreadsheet with all the clients’ payment due dates, so we would know when a call came in if it was potentially the “Groundhog” app causing lockups. One day a client’s payment was overdue and the deadline arrived. We waited all day but no call came in. We thought the app might have a bug. Lo and behold, at 4:00 p.m. the client called. The boss’s system was locking up (we only installed Groundhog on one system — the boss’s — so the company could work normally overall). Of course, we told them there was a balance due and we’d come out as soon as they paid it. They agreed to have a check ready. We scooted over there, got the check, waved everyone out of the boss’s office, and proceeded to reset Groundhog’s deadline. All was well. The funny part was that the client told us the lockups had started in the morning and he’d been on the phone with Microsoft Support all day, and they couldn’t figure out what the heck the intermittent problem was. The client was hoping Support could fix it so he wouldn’t have to call us and pay. He was planning to stiff us. Support had no idea about winstart.bat. We just chuckled and went on our way. I later found out such techniques were used by IBM (and ostensibly other companies) years before and were illegal.

Read less

I can’t say I’ll ever use this info but thank you so much for posting these things. You cover fascinating topics and it’s great to learn about what is or was the foundation of a platform I’ve used since I was a child.

Please don’t stop cranking these out! And yes please do discuss footnote 2 at some point 😁

I wonder if I know something that wants it.

https://github.com/PluMGMK/vbesvga.drv/blob/master/AUXSTACK.ASM

The problem is Windows gives quite a small stack to int10h and modern int 10h wants up to 1024 bytes for graphics mode.

In related news I don’t blame Otul Osan for asking; an internet search or three by me came up blank.

Interesting. Was it ever useful in Windows 95 or was it mostly of use in Windows 3.x?

I’m pretty sure some installers used it to delete or replace things that couldn’t be replaced while Windows was running – at least that’s how I became aware of winstart.bat (noticed something causing “File not found” to flash on screen just before the GUI was initialised, and then found winstart.bat which was attempting to delete some uninstaller). Yes, there were better ways of doing this, but when have programmers cared?

Load more comments

Stay informed

Get notified when new posts are published.

Email *

Country/Region *Select...United StatesAfghanistanÅland IslandsAlbaniaAlgeriaAmerican SamoaAndorraAngolaAnguillaAntarcticaAntigua and BarbudaArgentinaArmeniaArubaAustraliaAustriaAzerbaijanBahamasBahrainBangladeshBarbadosBelarusBelgiumBelizeBeninBermudaBhutanBoliviaBonaireBosnia and HerzegovinaBotswanaBouvet IslandBrazilBritish Indian Ocean TerritoryBritish Virgin IslandsBruneiBulgariaBurkina FasoBurundiCabo VerdeCambodiaCameroonCanadaCayman IslandsCentral African RepublicChadChileChinaChristmas IslandCocos (Keeling) IslandsColombiaComorosCongoCongo (DRC)Cook IslandsCosta RicaCôte dIvoireCroatiaCuraçaoCyprusCzechiaDenmarkDjiboutiDominicaDominican RepublicEcuadorEgyptEl SalvadorEquatorial GuineaEritreaEstoniaEswatiniEthiopiaFalkland IslandsFaroe IslandsFijiFinlandFranceFrench GuianaFrench PolynesiaFrench Southern TerritoriesGabonGambiaGeorgiaGermanyGhanaGibraltarGreeceGreenlandGrenadaGuadeloupeGuamGuatemalaGuernseyGuineaGuinea-BissauGuyanaHaitiHeard Island and McDonald IslandsHondurasHong Kong SARHungaryIcelandIndiaIndonesiaIraqIrelandIsle of ManIsraelItalyJamaicaJan MayenJapanJerseyJordanKazakhstanKenyaKiribatiKoreaKosovoKuwaitKyrgyzstanLaosLatviaLebanonLesothoLiberiaLibyaLiechtensteinLithuaniaLuxembourgMacau SARMadagascarMalawiMalaysiaMaldivesMaliMaltaMarshall IslandsMartiniqueMauritaniaMauritiusMayotteMexicoMicronesiaMoldovaMonacoMongoliaMontenegroMontserratMoroccoMozambiqueMyanmarNamibiaNauruNepalNetherlandsNew CaledoniaNew ZealandNicaraguaNigerNigeriaNiueNorfolk IslandNorth MacedoniaNorthern Mariana IslandsNorwayOmanPakistanPalauPalestinian AuthorityPanamaPapua New GuineaParaguayPeruPhilippinesPitcairn IslandsPolandPortugalPuerto RicoQatarRéunionRomaniaRwandaSabaSaint BarthélemySaint Kitts and NevisSaint LuciaSaint MartinSaint Pierre and MiquelonSaint Vincent and the GrenadinesSamoaSan MarinoSão Tomé and PríncipeSaudi ArabiaSenegalSerbiaSeychellesSierra LeoneSingaporeSint EustatiusSint MaartenSlovakiaSloveniaSolomon IslandsSomaliaSouth AfricaSouth Georgia and South Sandwich IslandsSouth SudanSpainSri LankaSt HelenaAscensionTristan da CunhaSurinameSvalbardSwedenSwitzerlandTaiwanTajikistanTanzaniaThailandTimor-LesteTogoTokelauTongaTrinidad and TobagoTunisiaTurkeyTurkmenistanTurks and Caicos IslandsTuvaluU.S. Outlying IslandsU.S. Virgin IslandsUgandaUkraineUnited Arab EmiratesUnited KingdomUruguayUzbekistanVanuatuVatican CityVenezuelaVietnamWallis and FutunaYemenZambiaZimbabwe

I would like to receive the The Old New Thing Newsletter. Privacy Statement.

Subscribe

Follow this blog

Insert/edit link

Close

Enter the destination URL

URL

Link Text

Open link in a new tab

Or link to existing content

Search

No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.

Cancel

Back to top

×

Notifications

PAN's pipeline reviewed approximately 1 open sources for this article. No human editor reviewed this article before publication.

Related Reads

Show on timeline →

Earlier on PAN

More in Technology →