views:

607

answers:

2

How can I write to parallel port through Windows XP command line?

+1  A: 

Back in the DOS days we would frequently use a command like type filename.txt > lpt1 to print our text files.

Zoredache
Actually I do not want to print file but I want to write the hex value FF into it so that all the lines become high.
Manoj
+3  A: 

Looking at your reply to Zoredache, your real problem is not output to the parallel port, that's trivial.

Your real problem is how to get a 0xff character on stdout. This is possible with a trivial .com executable which invokes the relevant soft interrupt, but to be honest it's probably easier to create a file with that single 0xff character in it and then just copy that to the printer:

> copy /b data.bin lpt1

Note the /b flag which tells copy that the file is a binary file.

Alnitak