No printer

  • Thread starter Thread starter Rich Pasco
  • Start date Start date
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
 
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.
 
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
 
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
 
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]
 
Back
Top