Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to print out all the content inside multiple files of different type in a directory with many sub-folders to a printer in a single click?

I am not asking for a directory listing or listing of files and folders in a directory.

I am asking whether how do I print out contents inside files of different types (can be doc, pdf, csv, cs) in different sub folders in a folder.

If it is impossible to perform with current software technology, are there other work around? I know the worst case is that I have to open each file and print it to the printer, which I hate to do it.

I notice a tool - PrettyCode.Print, but it cannot print other different file types such as doc, pdf, csv and so on.

share|improve this question
1  
what OS are you running? Assuming its scriptable, the precise scripting methods would depend heavily on the OS –  Journeyman Geek Apr 21 '13 at 2:56
add comment

1 Answer

Single click? Nah.

I believe you can select multiple MS-Office documents (though I'm not sure about multiple office document types) in windows explorer, and then select Print from the context (right-click) menu. If the type of documents are more than just office, it becomes more difficult, essentially you do have to open and print each file, but the process can be automated.

You need to know which program the file is created with, and have access to it. You need to know the command that program uses to print its files and be able to run those commands from the commandline, usually through switches, perhaps through its API, or possibly macros that can be run externally, or a combination.

With all that info, you can create a script that iterates through a directory listing and switches, depending on which file type it is, to access the correct program's printing functions through the API and prints it (opening and closing the program if necessary), before moving onto the next file.

Your first step is probably to google 'command line switches' for each application that has a file that you want to print.

A couple useful links/tips:

Print from Word command line: WINWORD.EXE test.rtf /q /n /mFilePrintDefault /mFileExit

/q - no splash screen; /n - don't open default doc

Printing adobe pdf from command line: AcroRd32.exe /t <filename.pdf>

/t <filename> <printername> <drivername> <portname> - Print the file to the specified printer

The above examples assume windows. It's the same process in *nix (and I assume OSX/mac), but obviously the programs owning the files and the commands to run them will be different.

After writing the script, setting it up as a shortcut or otherwise making it executable (lol, and testing), you could double click to get what you're looking for.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.