DOS Equivalent of UNIX Command

Hi,

The title of this post is a little vague but I couldn't think of what to call it.

In Unix you can perform the following command

ftp -v IPADDRESS <<END
    put FILE
END

In a DOS command prompt, is it possible to do the same kind of thing that the "<<END" does?

So for example, I want to open a command prompt from VB6 and pass keypresses to that window but have everything output to a file.

In Unix I could do the following

bash <<END > FILENAME.txt
# The following would be sent as keypresses
echo -n "This"
echo -n "is"
echo -n "a"
echo "test"
END

This would then create a file with "This is a test" as the contents.

I hope I'm not sounding too confusing.

Any help would be greatly appreciated.

Thanks! :D:b:

In DOS, you can

copy con: testfile.txt

then type at the screen, and everything will be sent to the file until you do a CTRL-z to end the copying

or, maybe

echo abcdef >> testfile.txt

will append the abcdef to the end of the existing testfile.txt

I don't think that is possible in DOS.

You can write a Batch File and put a PAUSE command to prompt user to press any key to continue. But there is no way to pass keystrokes.

1 Like

I agree with bipinajith - can't be done in DOS.
But - you can replace the standard command interpreter (command.com in older versions) by sth. like complus.com (a unix-like cmd interpr. for MS OSes) or the sh.exe found in Unxutils.

1 Like

Thanks for the help.

Unfortunately, this isn't exaclty what I meant.

What I wanted was to be able to use VB6 to open a command prompt (which I've managed) and then telnet onto a server by sending keypresses to the command prompt (which I've also managed) and I wanted the output for the command prompt to be sent to a file on my local machine.

I thought the best way to do this would be an equivalent of << in Unix

I have however, managed to get around it by running my telnet commands on the server and sending its output to a file on the server and then using Inet to FTP the file to my local computer.

Thanks to everyone.