?
Solved

Print dos screen

Posted on 2003-03-13
7
Medium Priority
?
3,265 Views
Last Modified: 2007-12-19
I have written a batch file that copies windows files and then writes a log file once copying is complete. I wan't a basic printout of the event to make sure everything is copied sucessfully, but the log printout would be equivalent to about 50 pages.

Is there any way that I can send the dos screen to the printer so that I get a printout such as

15 files copied in 5 folders
The following files could not be copied...

etc.

If not is there a way to filter the log file and then send that to the printer?

Any input would be appreciated.
0
Comment
Question by:Paduwan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 

Expert Comment

by:Lord_Lethris
ID: 8133274
NO, not that I know of.
0
 

Expert Comment

by:pjbcba
ID: 8133279
Do you want the Print out done manually, or as part of the script?
 - In you're running in pure DOS mode, hitting Prnt Scrn will send the current screen direct to LPT1. (In Windows it copies it to the Clipboard)

Possibly use the TYPE and FIND commands to filter the text file, eg

TYPE yourlog.txt |FIND /i "files copied in" >LPT1
TYPE yourlog.txt |FIND /i "not copied" >LPT1

The only problem is that this works line-by-line, so you would have to specify a unique seach string (like the "not copied" above) to get only the lines that you want. Is there something unique about the lines containing the errors that you could use?

But there are probably better ways of doing it in the batch file itself - could you post the contents of that file here?
0
 

Expert Comment

by:Lord_Lethris
ID: 8133335
good point pjbcba, I also think ther is a command string you can add to the end to stop the carrage return so that it won't print each line on a seperate piece of paper, But it's been so long since I touched that area of DOS that I have fergotten what it is.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:Paduwan
ID: 8133588
The printing has to be done from within the script, as the file copying will occur after hours through scheduling. I want a print out to be there in the morning so I can quickly browse over it and know that all files have been copied.

I'll post the script shortly...
0
 
LVL 49

Expert Comment

by:dbrunton
ID: 8133792
Probably for each copy or xcopy command you want to do something like

First line of script

copy c:\*.* d:\*.*  > logfile.txt

All other lines involving copying

xcopy c:\*.*   d:\*.*  >>  logfile.txt
copy c:\*.*   d:\*.*   >> logfile.txt

and the last line of the script

type logfile.txt > prn
0
 

Author Comment

by:Paduwan
ID: 8133845
There is only one copy command in the script, which copies around 2000 files.

Do you think this makes sense as a sort of filter:

>find "string" [path_to_logfile] > filename.txt

print filename.txt

So the find command searches the log file for only the information I want, exports it to a text file which is then printed?

Yes?
0
 
LVL 49

Accepted Solution

by:
dbrunton earned 40 total points
ID: 8133895
Yes.  Something like that should work.  Test it on a small number of files first.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question