See Bizhawk/DOSBox
[autoexec]
REM Detecting current boot cycle
set CYCLE=1
if exist c:\cycle1 set CYCLE=2
if exist c:\cycle2 set CYCLE=3
if exist c:\cycle3 set CYCLE=END
echo Executing Boot Cycle %CYCLE%
REM BOOT CYCLE 1 -- If not already installed, create temp install folder
if %CYCLE% == 1 mkdir win95
if %CYCLE% == 1 cd win95
if %CYCLE% == 1 echo [setup]>msbatch.inf
if %CYCLE% == 1 echo ProductType=1>>msbatch.inf
if %CYCLE% == 1 xcopy d:\win95 .
if %CYCLE% == 1 copy NUL c:\cycle1
if %CYCLE% == 1 setup msbatch.inf /is /ie
REM BOOT CYCLE 2 -- Keep track of cycle advance and boot into C:
if %CYCLE% == 2 copy NUL c:\cycle2
REM BOOT CYCLE 3 -- Cleanup install folder and boot into C:
if %CYCLE% == 3 copy NUL c:\cycle3
if %CYCLE% == 3 deltree /y win95
REM From now on, just reboot into Windows
boot c: