Printing from a dos program

  • Thread starter big man
  • Start date
  • #1
253
1

Main Question or Discussion Point

Hey guys,

I was wondering if any of you can help me with my problem. I have this really small DOS program (~40 kb) that I am running and it is based on Kramers' formula.

Now the thing is when you generate a graph in this program there is a message in the bottom right-hand corner that says "Press 'Print Screen' to print". I do this and it doesn't print.

So I thought I'd read up on it and I found that you need a program like DOS2USB or something like that. But when I installed it and pressed print screen it still didn't work. I definitely had the right printer selected.

Do you know how you might print something from a DOS program from windows XP???

Any advice would be greatly appreciated :)
 

Answers and Replies

  • #2
FredGarvin
Science Advisor
5,066
7
Print screen puts the entire screen into the copy buffer. If you hit that button, go to something like paint or powerpoint and hit CTRL-V and the entire screen will show up. I don't know of a way in Windows to print only the active window. You can get a free program like Hover-Snap to do that.
 
  • #3
253
1
Yeah unfortunately I tried the ctrl+v approach and nothing happened.

In paint and photoshop you can't paste it and in Word when you paste you just get several lines of square symbols.

This program can only be maximised fully or minimised fully. You can't get it so that it is a small window.

Thanks for replying though
 
  • #4
AlephZero
Science Advisor
Homework Helper
6,994
291
I don't know of a way in Windows to print only the active window. You can get a free program like Hover-Snap to do that.
Alt-PrintScreen works for me.
 
  • #5
russ_watters
Mentor
19,425
5,593
Get a photo editor with a screen cap utility or use the drop-down menu at the top-right of the dos window to select all and copy.
 
  • #6
195
0
hmm..

Have you tried running the program in the various compatibility modes?

You might have some kind of problem because there is no such thing as real dos system files in an emulated command window. If you run a dos program in windows xp, it's not true dos. It's an emulated dos and it uses dummy configuration files, so it may not be possible to set up dos to print correctly directly from the window (since that is something you had to set up in a sys file).

You'll probably want to use some print screen type utility. There are millions out there. Here's a freeware one if you want it (http://www.gadwin.com/download/ps_setup.exe" [Broken] to go to the webpage. (I haven't tested this program, I just googled for one and found one real quick for you)

Philip
 
Last edited by a moderator:
  • #7
Integral
Staff Emeritus
Science Advisor
Gold Member
7,198
55
You may well need the dos drivers for your printer. This may be nearly impossible to get. Go find yourself a old epson dot matrix.
 
  • #8
195
0
You may well need the dos drivers for your printer. This may be nearly impossible to get. Go find yourself a old epson dot matrix.
lol. I remember those slow ass printers.

Cmd.exe is an emulated dos (look up command.exe) though. It doesn't load sys files. The sys files exist in windows xp, but only for show in case a program in dos tries to reference or make changes to the file for some reason. They are 100% fake. I read the microsoft resource page regarding it and I researched this before, I just don't remember the links.
 
Last edited:
  • #9
253
1
Thanks for the advice guys. I will give that program a try BoredNL, but I don't have much hope. I have tried different compatibility modes, but they haven't worked either.

This program is really weird because it will ONLY operate in full screen mode. No matter what I do I can't make it load in a smaller window. I'm not sure if this would help with getting a screenshot, but who knows.
 
  • #10
195
0
Be sure to let us know if it works. :)

It might not work, because it might use a different screen buffer than other windows.

Ooh, I just thought of something.

Are you using an MS-Dos shortcut to run the program? If so, then this is the cause of your problem with it constantly maximizing. Right click on the file you are running and make sure "start maximized" is not selected.

If the screen capture program that I pointed you to doesn't work, there are plenty of other programs out there to try too.

Well, good luck. :)

Phil

-edit: oh one more thing. Does this program have a text output or is it graphical? Also, do you have to do anything in the program or is it just running and spitting out text? You could run it like this "program.exe >> file.txt", to get it to output to a text file. You would press CTRL + C to break out of the program once you think it's spit out the text you wanted it to.
 
Last edited:
  • #11
1
0
DOS Printscreen

Hey Big Guy
I have the same problem. I'm trying to copy waveforms from an old DOS QM program. I've done it in the past with no problems by using Alt + Printscreen and copying to MS Paint. However that was with Windows 2000. Now I'm trying in XP and cannot get anything to copy. So if you try W2k it may solve your problem.

Javlin
 
  • #12
mgb_phys
Science Advisor
Homework Helper
7,774
12
Printscrn should send the entire screen to the clipboard, alt-printscrn sends the active window, it may be that a full-screen DOS program doesn't have an active window.

If printscr on it's own doesn't work, you can either try graphics packages with a screen capture button life irfanview/paintshop or as a last resort you can run the dos program under virtualPC. This lets you capture the virtualPC screen whatever is running under it, we use it for capturing screen shots of installation steps that you can't normally grab.
 
  • #13
NoTime
Science Advisor
Homework Helper
1,568
0
This program is really weird because it will ONLY operate in full screen mode. No matter what I do I can't make it load in a smaller window. I'm not sure if this would help with getting a screenshot, but who knows.
This happens in the command window when the DOS program reasigns certain interupts like timer. The Cmd (DOS) window can be put in suspend mode and made resizable by hitting Alt-Enter key combination. Suspend mode means you can not do anything with the DOS program. With the Cmd window in suspend you can now use the normal windows functions on it. Alt-PrintScreen should make a copy that you past into paint and print.
 
  • #14
CRGreathouse
Science Advisor
Homework Helper
2,820
0
There are lots of ways. Off the top of my head:

1. Hit PrintScreen, copy image to word processor or photo editor, print. This will copy the whole screen.
2. Hit Alt + PrintScreen, copy image to word processor or photo editor, print. This will copy just the current window.
3. Right click in window, choose Mark, select area to be printed with mouse, press Enter. Paste the copied text to a word processor or text editor and print.
4. Save results to file and print with the DOS print command. If you start your program with the command "myProgram -l 42", you can save it to a file with the command "myProgram -l 42 > foo.txt" and print it with "print foo.txt".
5. Print the result directly from DOS with redirection. If you start the program with "myProgram -l 42" you can print it with "myProgram -l 42 > lpt1".

In 4 and 5 you may need to send enough blank lines to the printer to make the last page come out.
 

Related Threads on Printing from a dos program

  • Last Post
Replies
3
Views
6K
  • Last Post
Replies
4
Views
9K
Replies
2
Views
45K
Replies
7
Views
613
Replies
36
Views
32K
Replies
3
Views
3K
  • Last Post
Replies
17
Views
6K
  • Last Post
Replies
4
Views
5K
  • Last Post
Replies
13
Views
3K
  • Last Post
Replies
3
Views
2K
Top