Thursday, January 1, 2015

windows - print directory using command prompt



Found this one: http://www.watchingthenet.com/how-to-print-a-directory-tree-from-windows-explorer.html



But I don't know how do I do it and save the directory listing somewhere.
What I want to do is something like that, but I need an output file.
Or at least something that I can see.
What I need to do is to print the contents of a directory.


Answer



dir > dir_contents.txt

print dir_contents.txt


in short. You pipe it to the file of your choice, using dir options of your choice.



Edit:
If print doesn't work you can try this instead



start /w notepad /p dir_contents.txt



It uses notepad to print the file to your default printer.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...