• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Getting at old dos commands

sm625

Diamond Member
I have several legacy programs that work fine except they call dos cammands such as LIST and TYPE and attempt to redirect the output to a printer. Most of my legacy software calls a custom 16 bit program very similar to LIST. Since I have the source code I just updated that program to support win 7/8 and so all the legacy software that calls it now runs just fine. But for whatever reason, a few apps still make calls to LIST and TYPE, so I was wondering is there anyway to substitute dos LIST and TYPE for my own custom versions? I guess they are part of command.com.
 
Doskey?

I mean, you could create a cmd macro that does whatever the modern equivalent is in shell, or which calls a .exe of your own.
 
patch command.com, and change those commands to "TYP$" and "LIS$"? Or "TYP_" and "LIS_"?

That's exactly what I would like to do. Inside the command.com file I found the following:

Code:
SET [variable=[string]]

�  variable  Specifies the environment-variable name.
  string    Specifies a series of characters to assign to the variable.

KType SET without parameters to display the current environment variables.
4Displays or sets the system time.

TIME [time]

ƒType TIME with no parameters to display the current time setting and a prompt
for a new one.  Press ENTER to keep the same time.
FDisplays the contents of a text file.

TYPE [drive:][path]filename
%Displays the MS-DOS version.

VER

Is it as simple as changing TYPE to TYPD? Also, there is no LIST command anywhere in there that I can see.
 
Is LIST even a DOS command? I don't see it here:
http://en.wikipedia.org/wiki/List_of_DOS_commands

What does it do? Is it similar to MORE?

Changing TYPE to TYPD in COMMAND.COM with a hex editor might work I guess.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C: \Users\cabri>list
'list' is not recognized as an internal or external command,
operable program or batch file
.
C: \Users\cabri>
Probably thinking of dir

 
Interesting. Inside my legacy code I call a function called "system" which then calls the dos command, or other executable if it isnt a dos command. So when I call

Code:
system ("type myfile.txt > LPT1")

it tries to call the DOS TYPE command. But if I call
Code:
system ("mytype myfile.txt > LPT1")
it runs my program instead.

Now if I do a
Code:
system ("[B]LIST[/B] myfile.txt")
I get nothing, even though I have a program called LIST.exe. My program never gets called like you'd think it should. So I figure there must be a DOS command called list? But I cannot find any documentation on it.
 
Now if I do a
Code:
system ("[B]LIST[/B] myfile.txt")
I get nothing, even though I have a program called LIST.exe. My program never gets called like you'd think it should. So I figure there must be a DOS command called list? But I cannot find any documentation on it.

Have you tried using a fully-qualified path to your list.exe application? Or temporarily adding a call to "where.exe list" into your application to determine whether it's finding an alternate list.com or list.exe elsewhere in the path?
 
Last edited:
Dos command can be subbed by calling their FQN. "type.exe /somejunk" will override type inside command.com. Also you can call your executable directly without using command.com in the first place, then the embedded commands don't exist.
 
Back
Top