Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Directory subfolder

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
This is a strange question. I hope there is a way to accomplish this.

My boss wants to get a listing of all the folders we have on our P: drive (from the server) and all the subfolders so that we can see what type of hireracy we have have set up.

I'm hoping there is a way to do this so I don't have to do print screens for each one.

Any suggestions.
Sharon
 
You can do this from the command prompt by using the tree command.

tree P:\ > dirstruct.txt


this will yield a nice text file that describes the folder hierarchy under P:

You can use the /F switch if you wan to also show files.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I did the command and I see the file on my C drive but it is empty.

Sharon
 
Do it from the server.

I'm Certifiable, not cert-ified.
It just means my answers are from experience, not a book.
 
I will have to get permission to get on the server.

Thanks
Sharon
 
That's weird. how are you running it? Do you get an error?
It works for me and I get something that look like this:

Code:
Folder PATH listing for volume xxxx
Volume serial number is xxxx-xxxx
E:\
????Folder
?   ????SubFolder
?   ?   ????SubSubfolder1
?   ?   ????SubSubfolder2
?   ?   ????SubSubfolder3
?   ?   ????SubSubfolder4
?   ?   ????SubSubfolder5

there is a space between P:\ and the ">" also between the > and the name of the file.

etc...

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
The ??? should be ascii lines.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Actually nothing happens. Now I can't even get it to create the file name. I've checked the P drive and my documents on my C drive.

I typed in tree [space] P:\ [space]>[space]dirstruc.txt[space]/f

The cursor goes away and then pops up on the line below with a new command prompt. No file was created.

Sharon
 
Remove the /f at the end. it you want the files put the /f after the P:\ and before the ">"

Code:
tree P:\ /f > dirstruct.txt

I can run this exact command for my P drive and it works from my workstation as long a I have access to the drive which I should have.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Where does it put the file when it is done? I have looked on P and on C. I must be doing something small wrong.

does it matter if I'm on the root of my C drive when I do it?

Do you see anything happening when your file is being created?
 
Nothing happens while the file is being created, just the cursor blinks. The file should be created wherever you are located. So if you opened a command prompt and are located say:
C:\DOCUME~1\username> then that's where the file will be created.

You can be specific of where you want the file though:

Code:
tree P:\ /f > C:\myfile.txt

This will specifically create the file in the root of C:



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Finally got it to work, Thank you. I did have to do it on the server itself.

Thanks again
Sharon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top