Home
Man
Search
Today's Posts
Register

All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

DOS Equivalent of UNIX Command

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 12-19-2012
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
Code:
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
Code:
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!
# 2  
Old 12-19-2012
Unsure what you are trying to do, but...

In DOS, you can
Code:
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
Code:
echo abcdef >> testfile.txt

will append the abcdef to the end of the existing testfile.txt
# 3  
Old 12-19-2012
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.
The Following User Says Thank You to Yoda For This Useful Post:
Ste_Moore01 (12-19-2012)
# 4  
Old 12-19-2012
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.
The Following User Says Thank You to RudiC For This Useful Post:
Ste_Moore01 (12-19-2012)
# 5  
Old 12-19-2012
Thanks for the help.

Quote:
Originally Posted by joeyg
In DOS, you can
Code:
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
Code:
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.
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Locate equivalent in UNIX pradebban UNIX for Dummies Questions & Answers 4 11-29-2011 11:19 AM
smitty equivalent command line command asyed123 AIX 2 09-24-2011 12:12 PM
PHP Equivalent of the unix command vidhyaS Shell Programming and Scripting 0 06-27-2011 04:55 AM
dos/intel unix command equivalent MizzGail Windows & DOS: Issues & Discussions 6 02-06-2010 11:51 PM
Windows command shell equivalent in Unix simonsimon Shell Programming and Scripting 10 04-30-2009 02:56 AM
Equivalent of Substr in Unix saurabhsinha23 UNIX for Dummies Questions & Answers 7 12-11-2007 07:40 PM
Unix equivalent of DOS set xxavier UNIX for Dummies Questions & Answers 3 07-11-2007 09:14 AM
Equivalent command for setlocal in Unix sonaluphale UNIX for Advanced & Expert Users 7 05-17-2007 08:10 AM
IsDBCSLeadByteEx equivalent for unix anjan_kumar_k Programming 2 07-20-2006 02:22 AM
Equivalent unix command to minimize/maximize xterm window icemocha75 UNIX for Dummies Questions & Answers 0 01-27-2006 01:15 AM


All times are GMT -4. The time now is 02:40 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password