Windows 10: How to pipe the output of a command to the printer in Windows 10

  1. Posts : 2
    Windows 7 Pro 64-bit SP1
       26 Aug 2016 #1

    How to pipe the output of a command to the printer in Windows 10

    I'm at the command line.
    I want the output of the "set" command to go directly to my printer. I tried the following:

    set | notepad.exe

    I expected the output of the set command to become input to the notepad.exe command
    which then would print it out. Instead I get a blank notepad screen.
    I know the following works:

    set > filex
    notepad.exe filex

    This brings up the filex contents in notepad, which I can then print out.
    I would prefer to do it with one command.
      My ComputerSystem Spec

  2.    26 Aug 2016 #2

    $Content ="Some text"
    Set-Content -Path "myfile.txt" -Value $Content
    Invoke-Item "myfile.txt"

    Edit: I misread the requirement... is this what you want?

    #Print the file to default printer
    Get-Content -Path "myfile.txt" | Out-Printer
    Last edited by Superfly; 26 Aug 2016 at 06:13.
      My ComputerSystem Spec


Related Threads
Hi Guys, I'm getting quite frustrated with this issue and wondering if anyone has seen it, and able to resolve the issue. The issue is I have a network printer selected as the default in Windows 10. I have the option "Let Windows manage my...
I am attempting to add a printer via the command line using a batch file as an admin (to eventually deploy via SCCM TS on Win10): rundll32 printui.dll,PrintUIEntry /in /ga /n"\\my network printer" The command appears to run successfully but I am...
Starting in Windows 10 Insider Preview build 10565, Microsoft is introducing a new mode that makes your default printer the last printer you used most recently at your current location. This change helps ensure the best printer is preselected in...
Hi to all. I am having an annoing problem with shared printers. The user that share a printer lose the default printer in any case when another user print on this shared and it turn immediatly default printer only for the user that share the...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 09:54.
Find Us