No printer


R

Rich Pasco

I'm trying to run a legacy console (text-mode) executable application
on a Windows XP system with no printer, but it aborts with a "file not
found" error when it tries to open device "PRN:". The XP system has no
parallel port and no ASCII printer; all Windows printing is directed to
Windows network printers. I don't really need to print, I just want my
program to run and not abort.

The problem can also be demonstrated at the command line:

C:\>echo x > PRN:
The system cannot find the file specified.

How can I define PRN: as equivalent to NUL: so that my program will not
abort?

- Rich
 
Ad

Advertisements

M

Mark V

In said:
I'm trying to run a legacy console (text-mode) executable
application on a Windows XP system with no printer, but it
aborts with a "file not found" error when it tries to open
device "PRN:". The XP system has no parallel port and no ASCII
printer; all Windows printing is directed to Windows network
printers. I don't really need to print, I just want my program
to run and not abort.

The problem can also be demonstrated at the command line:

C:\>echo x > PRN:
The system cannot find the file specified.

How can I define PRN: as equivalent to NUL: so that my program
will not abort?
Interesting. I don't have a definitive answer since typically the
PRN: device is directed to LPT1:
You might confirm that at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
\DOS Devices\
PRN=\DosDevices\LPT1
(REG_SZ)

Then perhaps creating a printer object (on LPT1) with the Generic
driver might resolve the problem. Very uncertain here since you
have no physical parallel port present... If this works you will
probably end up spooling jobs and need to cancel/delete them.
All above is rather just guesswork and FWIW. Hope some other can
give you better info.
 
R

Rich Pasco

Mark, thank you, your suggestion helped me solve my problem!

At HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices
I found (among other things)

PRN \DosDevices\LPT1
NUL \Device\Null

I changed the definition of PRN to match that of NUL, like this:

PRN \Device\Null
NUL \Device\Null

and rebooted. It made both my problematical legacy EXE and the
command-line test work without complaint. I don't know if this
broke anything else, but if it did, I can always change it back
at a future date.

- Rich
 
M

Mark V

In said:
Mark, thank you, your suggestion helped me solve my problem!
You are welcome, even though that is not something I directly
suggested, exactly. LOL But it is good to hear that you found a
solution that works. FWIW I doubt that you will have any issues on
your system for your purposes. Thanks for the follow-up (and now
 
Ad

Advertisements

Joined
Jul 24, 2012
Messages
1
Reaction score
0
in command prompt print command not work properly how to solve the problem

on a Windows XP system with no printer, but it aborts with a "file not


The problem can also be demonstrated at the command line:

C:\>file > PRN:
The system cannot find the file specified.

How can I define PRN: as equivalent to NUL: so that my program will not
abort?

- Rich[/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Printer 0
ping a printer 4
Adding printers 0
default printer set 1
Roaming Printers/Users 1
Adding Global Printer 2
Extract Printer Information 2
adding printers HELP! 2

Top