Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to copy AND PRINT a file through dos COMMAND..
i am using
notepad/p d:\\kkk.txt
guide me.....
Posted
Updated 17-Nov-11 21:24pm
v2

Printing[^]

Copying can be done a few ways. Start with
copy c:\file.txt c:\file2.txt
and read this[^].

You can create a batch (.bat) or command (.cmd) file to carry out a series of command line instructions.
 
Share this answer
 
Do you actually need DOS command? I ask because you call notepad.exe, which isn't a DOS command - it is standard Windows application. I would suggest creating batch file and placing two commands inside: one should copy file, and another - print it.

Like, create file "MyCopyAndPrint.bat":
COPY %1 %2
TYPE %1 > PRN

You call this batch file like

MyCopyAndPrint.bat <FileName> <Destination>

There may be variations of the syntax: XCOPY[^] instead of COPY[^], quotes around "%1" and "%2" (which are source and destination, respectively), usage of PRINT[^] command instead of redirecting output to PRN or LPTx[^] devices... the result is basically the same :)
 
Share this answer
 
Comments
kalaiking 18-Nov-11 4:14am    
thnks..
but i need to print characters from that file..
how to avoid ejection..
Timberbird 18-Nov-11 4:28am    
PRINT or TYPE file.txt > PRN actually print contents of a file, i.e. all the symbols inside it. Do I understand your task wrong? You don't need to print file contents?
kalaiking 18-Nov-11 4:25am    
i need DOS command

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900