in reply to Filenames of "PRN" (or "PrN" etc) on Win32.

If you're on a copy of windows that has a mem.exe (most seem to, in $windir%\system32 on NTish systems, and %windir%\command on 95ish systems), mem /d will, IIRC, list known device names. I don't, however, have a running windows system to test this on.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Replies are listed 'Best First'.
Re^2: Filenames of "PRN" (or "PrN" etc) on Win32.
by BUU (Prior) on Aug 15, 2004 at 21:44 UTC
    If anyone cares, this the output for me on win2k:
    IO CON AUX PRN CLOCK$ COM1 LPT1 LPT2 LPT3 COM2 COM3 COM4 MSDOS IO KBD HIMEM XMSXXXX0 COMMAND MSDOS COMMAND DOSX MEM MEM MSDOS SYSTEM MSDOS MSCDEXNT DOSX VWIPXSPX MSDOS SYSTEM IO MOUSE REDIR NW16 MSDOS
      Only those under the first IO are relevant:
      CON AUX PRN CLOCK\$ LPT\d+ COM\d+
      There's also NUL, not listed.
      I get this on Win2K SP4:
        Address     Name          Size       Type 
        -------     --------     ------     ------
        000000                   000400     Interrupt Vector
        000400                   000100     ROM Communication Area
        000500                   000200     DOS Communication Area
      
        000700      IO           000370     System Data
                        CON                   System Device Driver 
                        AUX                   System Device Driver 
                        PRN                   System Device Driver 
                        CLOCK$                System Device Driver 
                        COM1                  System Device Driver 
                        LPT1                  System Device Driver 
                        LPT2                  System Device Driver 
                        LPT3                  System Device Driver 
                        COM2                  System Device Driver 
                        COM3                  System Device Driver 
                        COM4                  System Device Driver 
      
        000A70      MSDOS        001670     System Data
      
        0020E0      IO           003120     System Data
                      KBD        000CD0      System Program 
                      ANSI       001060      DEVICE=    
                        CON                   Installed Device Driver 
                      HIMEM      0004E0      DEVICE=    
                        XMSXXXX0              Installed Device Driver 
                                 000490      FILES=     
                                 000090      FCBS=      
                                 0001B0      LASTDRIVE= 
                                 0007D0      STACKS=    
        005210      COMMAND      000A20     Program   
        005C40      MSDOS        000070     -- Free --
        005CC0      COMMAND      000BA0     Environment
        006870      DOSX         0087A0     Program   
        00F020      MEM          000AB0     Environment
        00FAE0      KB16         0017D0     Program   
        0112C0      MEM          017550     Program   
        028820      MSDOS        0777C0     -- Free --
        09FFF0      SYSTEM       02F000     System Program
      
        0CF000      IO           003100     System Data
                      MOUSE      0030F0      System Program 
        0D2110      MSDOS        000AC0     -- Free --
        0D2BE0      MSCDEXNT     0001D0     Program   
        0D2DC0      REDIR        000A70     Program   
        0D3840      DOSX         000080     Data      
        0D38D0      MSDOS        00C720     -- Free --
      
      
          655360 bytes total conventional memory
          655360 bytes available to MS-DOS
          584992 largest executable program size
      
         1048576 bytes total contiguous extended memory
               0 bytes available contiguous extended memory
          941056 bytes available XMS memory
                 MS-DOS resident in High Memory Area
      
      Oddly, if I don't redirect the output it clears the screen halfway through. Must be generating a spurious character somewhere, which doesn't occur if you > the output.
Re^2: Filenames of "PRN" (or "PrN" etc) on Win32.
by BrowserUk (Patriarch) on Aug 15, 2004 at 21:05 UTC

    Indeed it does (on XP). Thanks, I was unaware of that one.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon