Command Line Input Redirection - VISTA

By dranfu ·

Does input redirection not work in Windows Vista?

I am trying to use a simple input redirection command to display text from a file in the command prompt window:

< MyFile.txt

This should take the data from the MyFile.txt file and display it on the command prompt window. However, I get an error that states "syntax is not correct" every time I try this.

I had no problems doing this in XP. Why does this no longer work in Vista? I have searched for answers but could not find any.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

If you want your text file to display

by Jacky Howe In reply to Command Line Input Redire ...

in a command window try this.

type MyFile.txt


type MyFile.txt |more

Collapse -

A couple more tips

by Jacky Howe In reply to If you want your text fil ...

type /? at a command prompt will give you instructions.

more /? will give you a list of switches.

Collapse -

Thank you

by dranfu In reply to A couple more tips

Thanks Jacky! But why can we not just use the input re-director? if ipconfig > ipconfig.txt works, why can we not use < ipconfig.txt and have it display.

It should still work this way.

Collapse -

When you use

by Jacky Howe In reply to Thank you

ipconfig > ip.txt you are redirecting the information from the ipconfig command to the text file.

when you type in
< ip.txt

you will get this error

The syntax of the command is incorrect.

It doesn't understand what you are trying to do.

If you use it with a command you will get a result.

command < file

command gets standard input from file

Redirecting Input


C:\date < datefile.txt

This is what happened: we issued the date command which stops and asks for the date. Then we used the < symbol to direct a response from a file called `datefile.txt'. The datefile.txt just contained simple ASCII text (The date) and a carriage return like this:


Collapse -

A bit more information

by Jacky Howe In reply to When you use

Related Discussions

Related Forums