is there a DOS command for running a program with windows 98 compatibility?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nnnmmm
Posts: 141
Joined: 26 Aug 2017 06:11

is there a DOS command for running a program with windows 98 compatibility?

#1 Post by nnnmmm » 20 Sep 2023 03:58

is there a DOS command for running a program with windows 98 compatibility?
example
start "" /win98 "resident evil 2.EXE"

start "" /win98 of course, i made this line up, but it was an idea

PC version "resident evil 2.EXE" has NO known emulators, so i must use windows 98 compatibility mode to get some stabilities.

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: is there a DOS command for running a program with windows 98 compatibility?

#2 Post by ShadowThief » 20 Sep 2023 13:02

Traditionally you right-click the application, go to Properties, go to the Compatibility tab, and pick the version you want compatibility with.

Windows 11 doesn't let you go older than Vista, so you may want to check out https://pcem-emulator.co.uk/ instead.

Batcher
Posts: 74
Joined: 16 Apr 2009 10:36

Re: is there a DOS command for running a program with windows 98 compatibility?

#3 Post by Batcher » 20 Sep 2023 20:25

test-1.bat

Code: Select all

@echo off
set "AppName=C:\Program Files\WinRAR\WinRAR.exe"
set "CompLayer=WIN98"
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%AppName%" /t REG_SZ /d "%CompLayer%" /f

nnnmmm
Posts: 141
Joined: 26 Aug 2017 06:11

Re: is there a DOS command for running a program with windows 98 compatibility?

#4 Post by nnnmmm » 20 Sep 2023 20:59

>go to Properties, go to the Compatibility tab,
not this manual way, everytime i meet the problem, it is not just only OS dependent but also fresh installation DEPENDENT, i never wanna go to that path. i removed every LNK file from games, some utilities, nircmdc and etc, i keep only everlasting, almost OS INDEPENDENT batch files that i can make them work on laptop, pc, all different resolutions, doxbox-x, scummVM. any OS's
i also removed or replaced windows shell extensions with ztree's batch shells, so windows explorer doesnt run anything in my pc's except for the default shells that can be auto-rebuilt themselves, i am a happy anti windows user, and DOS commands make me feel smarter

i found this line in website set __COMPAT_LAYER=WIN98, but i dont know how to use it

>Windows 11 doesn't let you go older than Vista
i dont have win11 yet, i have win8 and 10. there is probably a way to run old programs in win11 as much the same as win 8 and 10.
win 8 and 10 are the same, except win10 now forces uninstallable anti virus and slows down my laptop by 300% ~ 2000%, it always checks programs in my batches to the point of halt.
win8 and win10 also dont naturally run almost anything below vista, but emulators like CnC, dgVoodoo, nGlide, wine, scummVM made them run super nicely

while i was posting, a new thread came in, i will try this, registry editing needed and no simple command line
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%AppName%" /t REG_SZ

thanks

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: is there a DOS command for running a program with windows 98 compatibility?

#5 Post by ShadowThief » 20 Sep 2023 23:04

nnnmmm wrote:
20 Sep 2023 20:59
i found this line in website set __COMPAT_LAYER=WIN98, but i dont know how to use it
That's the entire command; there's nothing else.
https://stackoverflow.com/questions/378 ... 3#37881453

nnnmmm
Posts: 141
Joined: 26 Aug 2017 06:11

Re: is there a DOS command for running a program with windows 98 compatibility?

#6 Post by nnnmmm » 20 Sep 2023 23:56

Code: Select all

@echo off
SET "A1=%~dp0"
set "AppName1=%A1%CLAIREP.EXE"
set "AppName2=%A1%LEONP.EXE"
set "CompLayer=WIN98"

reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%AppName1%" /t REG_SZ /d "%CompLayer%" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%AppName2%" /t REG_SZ /d "%CompLayer%" /f
thanks this will do, made it pathname independent. normally i dont want to go with registry either, this is how i run games
1. install
2. export registries
3. backup
4. uninstall
5. run the backup with a proper registry reinput

example
delete all other 100s junk keys and leave only whats essential AND make it drive and directory name independent
change
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Monolith Productions\No One Lives Forever\1.0]
"WorkingDirectory"="w:\\@OK games\\NO ONE LIVES FOREVER 1\\"
to
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Monolith Productions\No One Lives Forever\1.0]
"WorkingDirectory"="."


my last question on how to delete registry but i didnt find one in website that i need
[HKEY_CURRENT_USER\SomeKey]
"SomeStringValue"="Hello"

[-HKEY_CURRENT_USER\SomeKey]

[HKEY_CURRENT_USER\SomeKey]
"SomeStringValue"=-

what would be the way to delete all values except for the key's name in this case the key name is somekey( which would be "Layers" later)
because AppCompatFlags\Layers : CLAIREP.EXE was in many registries, it spreads to the point deleting it often is not too plausible anymore
HKCR HKEY_CLASSES_ROOT
HKCU HKEY_CURRENT_USER
HKLM HKEY_LOCAL_MACHINE
HKU HKEY_USERS
HKCC HKEY_CURRENT_CONFIG

my random trials were, and didnt work
[HKEY_CURRENT_USER\SomeKey]
""=-
[HKEY_CURRENT_USER\SomeKey]
{}=-
[HKEY_CURRENT_USER\SomeKey]
=-

Batcher
Posts: 74
Joined: 16 Apr 2009 10:36

Re: is there a DOS command for running a program with windows 98 compatibility?

#7 Post by Batcher » 21 Sep 2023 02:33

CleanComp.bat

Code: Select all

@echo off
set "KeepApp1=WinRAR.exe"
set "KeepApp2=OneDrive.exe"
for /f "delims=" %%i in ('reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" ^| findstr ":" ^| findstr /v /c:"%KeepApp1%" /c:"%KeepApp2%"') do (
    set "StrFull=%%i"
    setlocal enabledelayedexpansion
    set "StrSuffix=!StrFull:*    REG_SZ    =!"
    call set "StrKey=%%StrFull:    REG_SZ    !StrSuffix!=%%"
    set "StrKey=!StrKey:~4!"
    reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "!StrKey!" /f
    endlocal
)

nnnmmm
Posts: 141
Joined: 26 Aug 2017 06:11

Re: is there a DOS command for running a program with windows 98 compatibility?

#8 Post by nnnmmm » 25 Jan 2024 06:04

Code: Select all

set "CompLayer=WIN98"
what would be the CompLayer value for WinXP and Window 8.1 and maybe for vista and windows 7?

maybe any of the below things?
"CompLayer=WINXP"
"CompLayer=WINDOWS XP"
"CompLayer=XP"
"CompLayer=XPSP3"
"CompLayer=WIDOWS8"
"CompLayer=WIN8"

websites didnt have much about CompLayer information
Alien Shooter 2 - Zombie Shooter 2 MOD worked well in Win8.1and XP but not in a Win10 computer.
i also made and tested a shortcut of "ZombieShooter2.exe" with the compatibility mode of windows xp and win 8 and etc, but the compatibility tests didnt work well in win10, and no known emulator, but i hope and want to get it to work with a batch file someday

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: is there a DOS command for running a program with windows 98 compatibility?

#9 Post by aGerman » 26 Jan 2024 11:06

Even if you don't find anything about it in the internet, it'd be so easy to figure it out. You know where the values are saved in the registry. So, just change the compatibility in the context menu of the executable and observe the updated registry value. Press F5 to reload the regedit interface.

Steffen

nnnmmm
Posts: 141
Joined: 26 Aug 2017 06:11

Re: is there a DOS command for running a program with windows 98 compatibility?

#10 Post by nnnmmm » 26 Jan 2024 23:13

there was no search result for the string "CompLayer" in regedit
but ZombieShooter2.exe had the results as below
~ WIN98
~ WINXPSP3
~ VISTARTM
~ VISTASP2
~ WIN7RTM
~ WIN8RTM
i just removed ~ for CompLayer=

it worked, thanks

jfl
Posts: 226
Joined: 26 Oct 2012 06:40
Location: Saint Hilaire du Touvet, France
Contact:

Re: is there a DOS command for running a program with windows 98 compatibility?

#11 Post by jfl » 29 Jan 2024 05:45

There's actually now a simple way to run any real DOS command.com in 64-bits Windows 10/11, including Windows 98's DOS 7.1 if you wish.
This allows testing batch files intended for Windows 98... Provided that they use only text-mode features, no graphics.

For that, download the msdos.exe DOS kernel emulator from: http://takeda-toshiya.my.coocan.jp/msdos/index.html
Think of this emulator as a kind of Docker engine for DOS applications.

Then install the DOS 7 executables in a directory. Ex:

Code: Select all

C:\JFL\Temp>dir \JFL\Tools\dos7
 Le volume dans le lecteur C n’a pas de nom.
 Le numéro de série du volume est B4F9-E8AF

 Répertoire de C:\JFL\Tools\dos7

2023-01-14  12:04    <DIR>          .
2024-01-26  21:13    <DIR>          ..
2023-01-14  12:04             9,719 ANSI.SYS
2023-01-14  12:04            15,252 ATTRIB.EXE
2023-01-14  12:04             2,047 BOOTDISK.BAT
2023-01-14  12:04            28,096 CHKDSK.EXE
2023-01-14  12:04             5,239 CHOICE.COM
2023-01-14  12:04            93,890 COMMAND.COM
2023-01-14  12:04            30,742 COUNTRY.SYS
2023-01-14  12:04           135,168 CSCRIPT.EXE
2023-01-14  12:04           122,975 CVT.EXE
2023-01-14  12:04            20,554 DEBUG.EXE
2023-01-14  12:04            19,083 DELTREE.EXE
2023-01-14  12:04            21,975 DISKCOPY.COM
2023-01-14  12:04            17,175 DISPLAY.SYS
2023-01-14  12:04            15,495 DOSKEY.COM
2023-01-14  12:04            68,871 DRVSPACE.BIN
2023-01-14  12:04             2,135 DRVSPACE.SYS
2023-01-14  12:04            69,902 EDIT.COM
2023-01-14  12:04            10,790 EDIT.HLP
2023-01-14  12:04            58,870 EGA.CPI
2023-01-14  12:04            93,242 EXTRACT.EXE
2023-01-14  12:04            20,574 FC.EXE
2023-01-14  12:04            63,916 FDISK.EXE
2023-01-14  12:04             6,658 FIND.EXE
2023-01-14  12:04            49,575 FORMAT.COM
2023-01-14  12:04            17,655 IEXTRACT.EXE
2023-01-14  12:04            19,927 KEYB.COM
2023-01-14  12:04            34,566 KEYBOARD.SYS
2023-01-14  12:04            31,942 KEYBRD2.SYS
2023-01-14  12:04            31,633 KEYBRD3.SYS
2023-01-14  12:04            13,014 KEYBRD4.SYS
2023-01-14  12:04             9,324 LABEL.EXE
2023-01-14  12:04            32,146 MEM.EXE
2023-01-14  12:04            29,271 MODE.COM
2023-01-14  12:04            10,471 MORE.COM
2023-01-14  12:04            27,299 MOVE.EXE
2023-01-14  12:04            25,473 MSCDEX.EXE
2023-01-14  12:04             6,940 NLSFUNC.EXE
2023-01-14  12:04           143,818 SCANDISK.EXE
2023-01-14  12:04             7,329 SCANDISK.INI
2023-01-14  12:04           165,502 SCANREG.EXE
2023-01-14  12:04            25,882 SORT.EXE
2023-01-14  12:04            28,672 START.EXE
2023-01-14  12:04            17,904 SUBST.EXE
2023-01-14  12:04            45,056 SULFNBK.EXE
2023-01-14  12:04            18,967 SYS.COM
2023-01-14  12:04             3,878 XCOPY.EXE
2023-01-14  12:04             3,878 XCOPY32.EXE
2023-01-14  12:04            41,472 XCOPY32.MOD
              48 fichier(s)        1,773,962 octets
               2 Rép(s)  831,897,104,384 octets libres

C:\JFL\Temp>
Then create a launch script called DOS7.bat:

Code: Select all

@echo off
setlocal EnableExtensions EnableDelayedExpansion

set "SCRIPT=%~nx0"				&:# Script name
set "SPATH=%~dp0" & set "SPATH=!SPATH:~0,-1!"	&:# Script path, without the trailing \
set "OS=DOS7"

path %SPATH%\%OS%;%SPATH%\DOS;%SPATH%

set "CMD=%*"
if not defined CMD set "CMD=%SPATH%\%OS%\command.com /K prompt [%OS%] $P$G"

:# Use msdos.exe from http://takeda-toshiya.my.coocan.jp/msdos/index.html
%SPATH%\WIN64\msdos.exe %CMD%
You can then use that script to start an interactive command.com prompt, or run a DOS command directly:

Code: Select all

C:\JFL\Temp>dos7

[DOS7] C:\JFL\Temp>truename %COMSPEC%

C:\COMMAND.COM

[DOS7] C:\JFL\Temp>exit

C:\JFL\Temp>dos7 C:\JFL\Tools\DOS\dirc.exe -V
3.8.1 2022-10-19 DOS ; MsvcLibX 2023-01-03 ; SysLib 2023-01-09

C:\JFL\Temp>
I've also installed FreeDOS executables in another directory, and created a FreeDOS.bat script similar to the one above. Both DOS7 and FreeDOS work with very similar results.
Last edited by jfl on 29 Jan 2024 06:34, edited 1 time in total.

npocmaka_
Posts: 516
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: is there a DOS command for running a program with windows 98 compatibility?

#12 Post by npocmaka_ » 29 Jan 2024 06:28

isnt compatibility layer set by __COMPAT_LAYER variable? -> https://stackoverflow.com/questions/378 ... ctually-do . Though this not work so well ... Can be set also through a shortcut settings.

Post Reply