DOS Shell through TCP/IP, File Sharing

I Have two PCs, connected through a 100 MBs hub.
One of them is running Windows XP, another is MS-DOS 6.2
on the dos machine i have installed Microsoft network Client 3.0 with TCP/IP and currently have access to my windows XP shared files

How can I run with a tcp (not udp, but i guess that is not the issue) socket set to stdio.
I would also like to be able to start other programs which could inherit stdio from that copy of command interpreter.

There is a similar thing when you run on a serial port, only here I need it through a LAN. One connection would be fine (considering the DOS's ability to multitask) and the machine could remain locked while expecting the connection. It wouldn't be a permanent connection.

Once again I stress that the use of file-sharing "at the same time" with dos-shell is crucial.
Who is Participating?
Linux has plenty of compilers, some should work in straight DOS.

Check Ralf Brown's Interrupt list and look for a packet driver. It comes with source code. A search will bring it up.

I hope this helps !
I don't think that DOS has the redirect option for a network of any kind.
It simply is beyond the design specifications.
You want to take what is essentially a TTY functionality and make it network compatible.

If you can code in C or assembly, you might be able to try writing some code for this, but it would be time consuming.
You would probably need to hook into something like a packet driver.

I would check out something like, and linux as alternatives.

I hope this helps !

srsrkiAuthor Commented:
Ok. a little help from what I found in the meantime

First of all I need a name of a good DOS C or C++ compiler preferably one that supports popen or a workaround so I could read input and output to a buffer from which i'd send/recieve to/from a tcp socket by using an interrupt procedure hooked to a timer to check the buffer states and send packets.

Also I need a way to use the tcp
I found something called PC/TCP that uses int 61 or int 60. So I guess that there's something similar with microsoft. probably on the same ints

any suggestions, ideas or code are welcome.
(any normal pascal based,c based assembly Basic,QB,VB etc programming language is OK even pseudo drawings).

any partial solutions will be taken under consideration and rewarded.
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

Maybe I am misunderstanding the request.  However, doesn't XP offer a command prompt through the use of the telnet server option just like Windows 2000?  I would assume so but I don't have an XP box in front of me.  This is the only way I know of currently to run a remote DOS prompt.  
I too am misunderstanding.

DOS does real poorly at unixy features such as stdio. But it does redirects ok. And the more recent versions enable that across network, through either name or more commonly through mapped drives.

So the Dos box could, say, have a batch file (or program)

RunSTDIO   <L:\MyXPinput.file    > M:\MyXPoutput.file

Noting, there is stdin, stdout, and stderr, each of which must be addressed to achieve success

> There is a similar thing when you run on a serial port,

I've no idea what you mean by that. is CLI, runs in ram, not on port. Old dos and OEMs had extra commands, such as mode, to enable similar features for port management. On XP we run Cmd.exe, not

NT family permits remote access to command prompt, by adding additional services, but that has little to do with stdio

Why not Run Visual Studio on the XP, assuming it is a power_unit, then you can choose between c++ and VB? There are common samples for passing messages back and forth for either udp or tcp, up to primitive mailers, telnet, etc.

> something called PC/TCP

Sounds like from origins of dos and 3.1 that became known as OnNet (32b for win9x)
srsrkiAuthor Commented:
Just to make things clearer.
I need a ms-dos shell ( dropped to a tcp socket in ms-dos environment.

I've managed so far to install tcp/ip on ms-dos machine (ping works, I can access files which are shared in my workgroup and are located on my xp pro machine) and I need the utility (or I have to write one if it doesn't exist) to take all outputs and send them through a tcp connection and take everything that arrives through a connection and send it to

Have some of you ever tried to connect two machines with a serial cable and on one of it start let's say " COM1 " and then on another machine ie. windows you open let's say hyperterminal and voila you have a prompt. The MS-DOS machine is piped to a COM1. Now I need the same functionality but with a network instead of COM1 to make the tcp socket my CONsole on a DOS Machine.

note. if anyone wants to try the above with the serial ports you have to set the baud rate,parity etc. with MODE.

OK, so presuming I have to write my own prog i'd need two things
1) pipes in DOS
2) microsoft's tcp packet driver programming interface specification or in a nutshell how to send and receive data through a tcp socket

Now is this a networking question or a programming question since it requires some network programming.

and please don't tell me that it can't be done cause i've seen pop3 mail servers for DOS.

so the DOS (but not the DOS box in a win or lin or BSD) could say for example.

myprog.exe set the port to 23 | myprog.exe

and an nt cmd.exe box would say for example
and in telnet i'd get some sort of msdos prompt

The reason I need it is that I have to control a pc real-mode environment program remotely from a network.
The Alternative is to make a frankenstein of two pc's to do the work of a smart software.
srsrkiAuthor Commented:
sorry I've just remembered I can't use | myprog.exe but I could use something like myprog.exe DoYourThingWith
Well, there is a way - but it's highly insecure (as almost all telnet based communication usually is, but that one does not verify usernames or passwords, either. You might be able to add those things (encryption, login) by simply using cygwin's (thats Unix tools for DOS) ssh server, but if you don't want to do that, here's how to get a shell per TCP:

The program you are looking for is called 'netcat'. It can be used as a server or as a client, we're using the server portion here.

Once you downloaded netcat and installed it (link below), start it with:

nc -l -p1234 -d -e –L

the -L puts it in "Listen" mode, at the port specified with -p (1234 in this example) and will execute when you connect.

Now, from the client machine telnet to the server machine on port 1234 and you'll have your shell. To connect it to the "standard" telnet port, so all you have to type is "telnet dest", use -p 23

Make _absolutely_ sure, you are the only one to be able to connect there. Otherwise you'll be in a world of hurt as soon as the first telnet scanner comes past you IP block.

NetCat download URL:
Man thats asking for big trouble! If one person finds that open port your hash.
That's what traffic filters are generally for. But, yes, that's what I say in my posting.
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
John Gates, CISSPSecurity ProfessionalCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ'd Split points between sysexpert and jluster

Please leave any comments here within the next seven days.


EE Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.