How to Edit the Registry – From the Command Line (Add, Delete & Modify)
You have probably used the windows registry to add, edit or delete entries. But why use a GUI, when the Command Line exists? Introducing the REG Command!
Welcome!
This guide is all about viewing our directory structure from the windows command line (cmd) using the tree command.
Lets get started!
The tree command can make it very easy for you to locate files and folders using the command line. You can view how your directory is structured and where every file is located from your command prompt (CMD).
Upon typing tree in your command prompt you can see how your current as well as every sub directory within it is structured.
Tree
Any directories and sub directories will immediately show up forming a network or a tree of every folder, hence the name.
Tree without any parameters only displays directories or folders, to include files in the output use the /f parameter.
Tree /F
The CMD will immediately list every file and folder from your current directory and on wards.
To save the output of a tree command into a text file use the greater than redirector followed by the location in which you want to create your file as well as the name you want your file to have.
Tree /F > "C:\Users\Julian\Desktop\Output.txt"
In the example above i chose to create a text file named Output.txt in my desktop directory.
You can even tree to view the contents of your entire drive. Simply type tree followed by the label of the drive you want to view.
Tree C:\
Or alternatively use the %homedrive% environment variable followed by a backwards slash.
Tree %homedrive%\
It might take a while for this to complete, depending on the size of your drive, to stop the output simply press Control + C in your keyboard and the operation will be aborted at once.
The tree command includes several useful parameters which you can use to alter its function.
Display every folder in the current directory and any sub directories:
Tree
List every file and folder in the current directory and any sub directories:
Tree /F
Show every file and folder starting from a specific directory, in this case the desktop folder.
Tree /F "C:\Users\Julian\Desktop"
Display the directory structure of a drive (replace the “C” character with the label of your drive):
Tree C:\
Display the directory structure of your entire home drive (usually C:\):
Tree %homedrive%\
Write the output of the command into a file.
Tree > "Output.txt"
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
You now know how to use the Tree command in the windows command line.
If you liked this short guide take a look at a few of our other posts related to the windows command line, or if you really liked it consider enrolling in our video course where you will learn the ins and outs of the Windows command Line.
This course has everything you need to start learning about the windows command line along with batch scripting.
You have probably used the windows registry to add, edit or delete entries. But why use a GUI, when the Command Line exists? Introducing the REG Command!
File attributes grant or deny certain rights to every file and folder. The attrib command can be used to view or change file attributes on files or folders.
A redirector or pipe is a special symbol that is used to redirect the input or output of a command or combine two or more commands in various ways.
Learn the Windows command line And Become an Expert!