1.    26 Aug 2016 #1
    Join Date : Mar 2016
    Southern California
    Posts : 2
    Windows 7 Pro 64-bit SP1

    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 System SpecsSystem 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 System SpecsSystem Spec


Similar Threads
Thread Forum
Default network printer randomly defaults to the adobe PDF printer
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...
Drivers and Hardware
Network Printer Not Showing When Installing via Command Line
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...
Drivers and Hardware
Printer - Turn On or Off Let Windows 10 Manage Default Printer
How to Turn On or Off Let Windows 10 Manage Default Printer Starting in Windows 10 Insider Preview build 10565, Microsoft is introducing a new mode that makes your default printer the last printer you used. This change helps ensure the best...
Shared printer problem with windows 10 printer default manage
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...
Network and Sharing
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 01:45.
Find Us
Twitter Facebook Google+

Windows 10 Forums