You can do the following
dir > f && print f
If you get the error Unable to initialize device PRN
, then you will need to specify the printer using the /D:
switch with the print command. You can also delete the file after running the command if you want.
dir > f && print f /D:"Printer Name" && del f
To do it without outputting to a file you can just redirect the command output to a shared printer.
dir > \\share\printer
To get a list of shared printers use PowerShell
get-WmiObject -class Win32_printer | ft name, systemName, shareName
I prefer outputting to a file then printing the file, so the name of the print job has some relevance to the actual content.