Matthew MacGregor
Matthew MacGregor

Reputation: 13

Type command not working in Windows command prompt

Correct me if I'm wrong, but the type command is supposed to display the contents of a text file in the Windows command prompt. But whenever I use the type command to display a text file, the output is only:

Unable to initialize device PRN

The command used is:

type C:\Users\Matthew\Desktop\Hello.txt

I don't know why it's doing this and I can't seem to figure it out. So if anyone could help me, it would be greatly appreciated.

Upvotes: 0

Views: 5364

Answers (2)

yackitty
yackitty

Reputation: 21

You echoed a 'print' command response to your file.

Open it with Notepad to verify.

Type is working (that's what's in the file).

Upvotes: 2

Bloodied
Bloodied

Reputation: 975

"Unable to initialize device PRN" is an odd error, you must be using an old version of Dos which is attempting to use a printer.

Which means you're either using the print command, or something you're trying to type is confusing the type command and returning an error.

set /p text=<type C:\Users\Matthew\Desktop\Hello.txt
echo "%text%" && pause

Upvotes: 0

Related Questions