Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Printing from a dos program

  1. Mar 12, 2007 #1
    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 :)
  2. jcsd
  3. Mar 12, 2007 #2


    User Avatar
    Science Advisor

    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.
  4. Mar 12, 2007 #3
    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
  5. Mar 12, 2007 #4


    User Avatar
    Science Advisor
    Homework Helper

    Alt-PrintScreen works for me.
  6. Mar 12, 2007 #5


    User Avatar

    Staff: Mentor

    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.
  7. Mar 13, 2007 #6

    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)

    Last edited by a moderator: May 2, 2017
  8. Mar 13, 2007 #7


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
  9. Mar 13, 2007 #8
    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: Mar 13, 2007
  10. Mar 13, 2007 #9
    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.
  11. Mar 13, 2007 #10
    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. :)


    -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: Mar 13, 2007
  12. Oct 18, 2007 #11
    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.

  13. Oct 18, 2007 #12


    User Avatar
    Science Advisor
    Homework Helper

    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.
  14. Oct 18, 2007 #13


    User Avatar
    Science Advisor
    Homework Helper

    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.
  15. Oct 19, 2007 #14


    User Avatar
    Science Advisor
    Homework Helper

    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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook