leecher1337 / ntvdmx64

Run Microsoft Windows NTVDM (DOS) on 64bit Editions
820 stars 81 forks source link

Loading ANSI drivers at system startup so they work in cmd prompt. #211

Open ghost opened 1 year ago

ghost commented 1 year ago

Is there a scripted way to do this? Regkey?

leecher1337 commented 1 year ago

That's easy, just edit Windows\SysWOW64\config.nt and add:

device=%SystemRoot%\system32\ansi.sys

Then you can see ANSI-colors in DOS-programs. For example, you can download

https://www.robvanderwoude.com/files/ansidemo.zip

and then run it with

command /cansidemo.bat

And tadaa: image

peter8777555 commented 1 year ago

By the way,

I try Ansi.com and AnsiDemo.exe ,it works.

I try Ansi.com and ansidemo.bat ,it failed ?

You can run GoTest.bat for testing.

peter8777555 commented 1 year ago

That's easy, just edit Windows\SysWOW64\config.nt and add: device=%SystemRoot%\system32\ansi.sys

Try 1 : command /cansidemo.bat

It works.

Try 2 : command ansidemo.bat

It failed

leecher1337 commented 1 year ago

That's how it is on Windows. If you think about it a little, you can guess why it behaves this way: command.com executes entered commands via Windows execute call. .bat files are normally handled by Windows NT cmd.exe, so no NTVDM involved when running .bat files, Therefore no ansi.sys in memory that can handle it, asno DOS involved. If you explicitly force it to execute in ntvdm with command /c, then it gets executed within NTVDM and it will show up fine.

peter8777555 commented 1 year ago

Thank you for detail info.