Visit The New, Modern Unix Linux Community

DOS Equivalent of UNIX Command

Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions DOS Equivalent of UNIX Command
# 1  
DOS Equivalent of UNIX Command


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
    put FILE

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"

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! SmilieSmilie
# 2  
Unsure what you are trying to do, but...

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
# 3  
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.
This User Gave Thanks to Yoda For This Post:
# 4  
I agree with bipinajith - can't be done in DOS.
But - you can replace the standard command interpreter ( in older versions) by sth. like (a unix-like cmd interpr. for MS OSes) or the sh.exe found in Unxutils.
This User Gave Thanks to RudiC For This Post:
# 5  
Thanks for the help.

Originally Posted by joeyg
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
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.

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #11
Difficulty: Medium
IBM chose the name System/360 (or S/360) because it was one of the first computers to focus on graphics processing.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PHP Equivalent of the unix command

Hi Can any one please let me know which will be the PHP equivalent of the below Unix statement, curl -H "Content-type: application/json" -H "Accept: application/json" --data-binary '{"text" : "how to check the temperature?"}' -H "X-JaskUid:111" -X POST ""'Thanks in advance!! ... (0 Replies)
Discussion started by: vidhyaS
0 Replies

2. Windows & DOS: Issues & Discussions

dos/intel unix command equivalent

In Unix I can use command line to do a find for files older than so many days and remove them. I can also capture the date to see if its a saturday and do something different. Are there any dos/intel command line equivalent commands to do this on a windows 2003 server? This is from an... (6 Replies)
Discussion started by: MizzGail
6 Replies

3. Shell Programming and Scripting

Command for unix to dos conversion

Dear All Could you please advice how do we convert a unix file to dos I know one command,ux2dos, which somehow does not work to give desired output Inputs on this is appreciated Thanks, Suresh (3 Replies)
Discussion started by: sureshg_sampat
3 Replies

4. Shell Programming and Scripting

Windows command shell equivalent in Unix

In Windows we use cmd.exe \c as the command SHell What is its equivalent in UNIX ? Thanx for all your help. (10 Replies)
Discussion started by: simonsimon
10 Replies

5. Windows & DOS: Issues & Discussions

what is the DOS equivalent of alias command?

how do we create aliases to commands in dos? thanks (9 Replies)
Discussion started by: milhan
9 Replies

6. UNIX for Dummies Questions & Answers

Unix equivalent of DOS set

Hi all, what is the equivalent command of the DOS set that lists all the environment variable and their values? Xavier. (3 Replies)
Discussion started by: xxavier
3 Replies

7. UNIX for Advanced & Expert Users

Equivalent command for setlocal in Unix

Hi all, Is there any command in unix equivalent to setlocal in windows. setlocal command is really useful in restoring local environment variables in windows. Thanks, Sonal. (7 Replies)
Discussion started by: sonaluphale
7 Replies

8. UNIX for Advanced & Expert Users

Command equivalent to DOS mode for SCO 5.0.6

I need to set the serial port attributes to 9600,7,E,1 in order to read and write data to it from within a Foxpro program. Unfortunately there is no function in Foxpro to set the line attributes, only open. close read and write. Stty only works on the stdout and stdin in this release, and the... (3 Replies)
Discussion started by: jgt
3 Replies

9. Windows & DOS: Issues & Discussions

SQL Spool equivalent command in DOS

This question maybe in the wrong category but I'm posting here due to urgency. In DOS is there a command to perform a similar function to spool command in SQL or Script command in UNIX? I want to print all command line output to a file but I don't want to use the echo command for each line. ... (2 Replies)
Discussion started by: stevefox
2 Replies

10. UNIX for Dummies Questions & Answers

Question about DOS versus Unix Command?

Okay here is a DOS comparison. When I search for a file in DOS and I was not sure what directory it was in then I would put dir /s/o/p filename the s would tell it to look in every directory including subs, the o would sort it alphabetically and the p would limit the display to one page at a... (1 Reply)
Discussion started by: wmosley2
1 Replies

Featured Tech Videos