3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Advanced Batch

Step 9> Parameter (1/2)

> Parameter (1/2)
«
  • cmd DIR.JPG
  • cmd dir output.JPG
  • cmd dir output txt.JPG
  • windows dir txt.JPG
  • notepad dir txt.JPG
This next bit isn't really a 'command,' but rather an added syntax into other commands. What it does is it takes the Output of a certain command, and can write it into a Text file. It's easier to explain if you see it in action first.
Its syntax is:
Command>Filename
Ok, so let's say we're in a certain directory. We then use the DIR Command, which, if you read the Basics of Batch, you would know as showing the contents of your current directory.
C:\Users\Neo\>DIR
Would normally output:
 Volume in drive C is HP Volume Serial Number is BC7E-E26C Directory of C:\Users\Neo06/30/2007  11:14 AM    <DIR>          .06/30/2007  11:14 AM    <DIR>          ..03/17/2007  06:41 PM    <DIR>          .idlerc02/19/2007  03:14 PM    <DIR>          Contacts06/19/2007  10:44 PM    <DIR>          Desktop06/29/2007  08:47 AM    <DIR>          Documents06/19/2007  10:35 AM    <DIR>          Downloads02/19/2007  03:14 PM    <DIR>          Favorites02/19/2007  03:14 PM    <DIR>          Links05/12/2007  04:01 PM    <DIR>          Music06/30/2007  01:20 AM    <DIR>          Pictures04/07/2007  03:08 PM    <DIR>          Saved Games02/19/2007  03:14 PM    <DIR>          Searches03/01/2007  07:23 PM           242,947 Test Record.wma06/19/2007  10:39 AM    <DIR>          Videos06/18/2007  09:57 AM         1,324,574 wp_screenprint_mc.pdf06/18/2007  09:59 AM        73,996,533 wp_tshirt_full.mp4               4 File(s)     75,564,054 bytes              14 Dir(s)  132,927,537,152 bytes free
But, if we add the > and to it...
C:\Users\Neo\DIR>DIRContents.txt
We don't get an output, but instead, we get a brand-spankin'-new Text File named DIRContents.txt which has the Output in it! Coolness!

But wait, there's a problem! I want to have multiple outputs in the same file, but my > just keeps overwriting it, and not adding it! What do I do?
« Previous StepDownload PDFView All StepsNext Step »
4 comments
Apr 21, 2011. 2:38 PMcrazyman135790 says:
cd..
cd..
cd..
cd..
cd..
dir /s
Jun 2, 2009. 12:30 PMrickyFo says:
when i try this, i get acces is denied I wanted to take a DIR of a Users file on windows, so i typed in... CD C:\Users (to get to the folder, then i typed) C:\Users>DIR>DIRContents.txt (C:\Users> i did not type in, i typed in DIR>DIR Contents.txt) and then it came up with access denied
Apr 10, 2010. 8:48 PMGuard13007 says:
 Access denied means your user acount doesn't have permission to do something you're trying to do. Such as create a file like you are here.
Jul 19, 2009. 12:52 AMDNR says:
dont put space bwn dir>dircontent.txt
Feb 10, 2010. 9:53 AMgraboy says:
I get "FIle not found." now what?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
22
Followers
5
Author:Neodudeman