1.

Solve : con & prn??

Answer»

in cmd, and windows.. why does TYPING 'con' or 'prn' = blank ?

like if i named a file or folder prn or con , it would just revert back to its original title.
if i tryed it from write to create a new file i mean , it would come back.. "cannot create the C:\documents and settings\%username%\desktop\con file. is this because of the same flaw that makes "this app can break" work?

also , clock\$ returns "the system cannot find the file specified" why? CON and PRN go way back to the wild and wooly days of DOS where they were reserved device names. The tradition has been carried forward thru all the iterations of Windows. The more things change....

Quote

MS-DOS supports five standard character devices which can be used by name as read or write destinations (according to their capacities).

(1) CON (Console=monitor/keyboard)
COPY textfile.txt CON
Copies textfile.txt to CON (output=monitor display), so displaying textfile.txt contents (similar to TYPE).

COPY CON textfile.txt
Copies line(s) of text typed at CON (the keyboard) to textfile.txt. To finish text entry, press Ctrl Z then RETURN . USEFUL for creating small text files.

(2) PRN (Printer)
COPY /b textfile.txt PRN
Copies textfile.txt to PRN (your standard printer). By default, COPY to devices is ASCII-based (terminates on Ctrl Z ), so /b(=binary) is used if the file to be printed contains intermediate Ctrl Z characters.

(3) AUX (Auxiliary device)
Not normally used in Batch files.

(4) CLOCK$ (System clock)
Not normally used in Batch files.

(5) NUL ("Bit bucket")
COPY c:\src\*.* c:\dest\*.*>NUL
Copies files from c:\src to c:\dest with all the progress messages from COPY sent to NUL. Characters sent to NUL are merely discarded, so redirection to NUL is useful to suppress unwanted messages.

Other devices supported usually include:
COM1 First serial port (often connected to modem)
LPT1 First parallel port (an alias for PRN)

...courtesy Allenware.com

Quote from: Diablo416 on April 26, 2007, 02:59:09 PM
also , clock\$ returns "the system cannot find the file specified" why?

Please explain a bit more what you're trying to do here.


Discussion

No Comment Found