Windows 10 doesn't have a DOS kernel anymore. How can DOS commands be executed?
By virtualizing or more accurately emulating.
Or does this code pass it on to the Windows Console? And thus allow
access to the Windows command prompt or Powershell?
As above, see, (real) DOS kernel is something impossible and even if it is possible it will compromise the
OS security rendering Windows
OS unusable, in past era DOS kernel only ran in real mode or protected mode, meaning it has
access to low level hardware interrupt, this can't be allowed in modern
OS, all application and services should be in virtual mode context, so the solution is create an emulator to emulate most of the functionality, which is not different at all except for..
The source code tells me that DOS must mean the operating system console, Windows Console or PowerShell, since normal DOS can't multitask. But DOSCommand can, according to the source code.
To clear this confusion and extend the answer for the above question, lets answer what is the difference between
GUI and console application, the answer is nothing ! except
console application had special flags in the EXE to make the
OS automatically create the pipes for the emulation host app while
GUI application doesn't have this. (by pipes i mean the stdinput and stdoutput..)
For fun application try to use WriteLn in
GUI application
play with such code and see how closing the console will terminate the
GUI app !
Delphi-Quellcode:
procedure TForm10.Button1Click(Sender: TObject);
begin
AllocConsole;
end;
procedure TForm10.Button2Click(Sender: TObject);
begin
Writeln('
Testing console output from GUI application');
end;
To read more about consoles
https://learn.microsoft.com/en-us/wi...nsole/consoles
And again to assert, there is no real DOS command in windows, only allowed emulated behavior (input/output).