| 1. |
Solve : A little help with batch? |
|
Answer» copy con is an old command that usually used to create a file. copy <file> con will copy a file to the screen. the output cannot be piped, since the output isn't on stdout but rather directly to the output console, the screen.copy con - copy from file to console, great, i never the syntax exist. for clarification, i usually use 'copy con file', not 'copy con>file', a mistake i made in the above post. now if only type 'copy con', whatever i type+enter is displayed twice, so i believe the extra echoed string is save into file when using 'copy con file' Quote from: BC_Programmer on June 03, 2009, 04:59:09 PM the numbers 1 through 3 are actually valid filehandles, and represent the standard Input, output, and error streams.i agree it's actual file handles in windows. but in nt batch, i am sticking with this until i am PROVEN wrong: 1> std-out 2> std-err 3> console not sure about std-in represent what number.CON represents both stdin and stdout- it DEPENDS on the context. for example, copy con would be stdin, since it's reading from con. copy con would be stdout, since it's WRITING to the console. |
|