Export directory structure to txt

Hi , I remeber that there was a button in king of da click's theme to export directory structure to txt.

I would like a button to do that. When im On a particular folder, id like to have the structure exported of the current folder with all the subfolder. One without files and one with files. I searched in the button section but couldn't find anything. Any help is appreciated. Thanks.

I don't know about the button you remember, but possibly the Print Folder command is the place to start.

ok thanks. But how to achieve that what i need with the print folder command. ?

I think these are the commands you meant from the theme...

<?xml version="1.0" encoding="UTF-8"?> <usercommand> <label>UserCommand2</label> <tip>Displays a printable folder tree report (with or without files) of folder in Notepad.</tip> <template>FILES/S,PATH/K</template> <icon1>137</icon1> <function type="batch"> <instruction>Runmode Hide</instruction> <instruction>@nofilenamequoting</instruction> <instruction>@firstfileonly</instruction> <instruction>:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</instruction> <instruction>:: ::</instruction> <instruction>:: PrintTree ::</instruction> <instruction>:: Directory Opus 8 User Command wrapper for Tree.com ::</instruction> <instruction>:: Version: 2.0 ::</instruction> <instruction>:: Kenneth R. Alcock ::</instruction> <instruction>:: ::</instruction> <instruction>:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</instruction> <instruction>:Start</instruction> <instruction> @Echo OFF &amp; If /i NOT [%OS%]==[Windows_NT] Goto 95-98-ME</instruction> <instruction> Title Folder Tree Report</instruction> <instruction>:SetVars</instruction> <instruction> Call Set ReportPath={sourcepath$|noterm}</instruction> <instruction> Call Set Filename=Folder Tree Report--{Date|yyyy&apos;-&apos;MM&apos;-&apos;yy}-{Time|HH&apos;.&apos;mm&apos;.&apos;ss}.txt</instruction> <instruction> Call Set Files=&amp;FILES&amp;</instruction> <instruction> Call Set PassedPath=&amp;PATH&amp;</instruction> <instruction> If .%Files%.==.1. (</instruction> <instruction> Call Set TreeParams=/A /F</instruction> <instruction> ) Else (</instruction> <instruction> Call Set TreeParams=/A</instruction> <instruction> )</instruction> <instruction> If Defined PassedPath (</instruction> <instruction> If Not Exist &quot;%PassedPath%\.&quot; (</instruction> <instruction> Call Set BadPath=TRUE</instruction> <instruction> ) Else (</instruction> <instruction> Call Set ReportPath=%PassedPath%</instruction> <instruction> )</instruction> <instruction> )</instruction> <instruction> </instruction> <instruction>:Report</instruction> <instruction> &gt; &quot;%TEMP%\%Filename%&quot; Echo.Date: {Date|yyyy&apos;-&apos;MM&apos;-&apos;yy} {Time|HH&apos;:&apos;mm&apos;:&apos;ss}</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Echo. </instruction> <instruction> If Defined BadPath (</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Echo. Invalid Path Passed!</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Echo. %PassedPath%</instruction> <instruction> ) Else (</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Tree %TreeParams% &quot;%ReportPath%&quot;</instruction> <instruction> )</instruction> <instruction> Start /wait &quot;Notepad&quot; Notepad &quot;%TEMP%\%Filename%&quot;</instruction> <instruction> Del /Q &quot;%TEMP%\%Filename%&quot; &gt; Nul</instruction> <instruction> Goto :EOF</instruction> </function> </usercommand>

and

<?xml version="1.0" encoding="UTF-8"?> <usercommand> <label>UserCommand1</label> <tip>Displays a printable folder tree report (with or without files) of folder in Notepad.</tip> <template>FILES/S,PATH/K</template> <icon1>137</icon1> <function type="batch"> <instruction>Runmode Hide</instruction> <instruction>@nofilenamequoting</instruction> <instruction>@firstfileonly</instruction> <instruction>:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</instruction> <instruction>:: ::</instruction> <instruction>:: PrintTree ::</instruction> <instruction>:: Directory Opus 8 User Command wrapper for Tree.com ::</instruction> <instruction>:: Version: 2.0 ::</instruction> <instruction>:: Kenneth R. Alcock ::</instruction> <instruction>:: ::</instruction> <instruction>:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</instruction> <instruction>:Start</instruction> <instruction> @Echo OFF &amp; If /i NOT [%OS%]==[Windows_NT] Goto 95-98-ME</instruction> <instruction> Title Folder Tree Report</instruction> <instruction>:SetVars</instruction> <instruction> Call Set ReportPath={sourcepath$|noterm}</instruction> <instruction> Call Set Filename=Folder Tree Report--{Date|yyyy&apos;-&apos;MM&apos;-&apos;yy}-{Time|HH&apos;.&apos;mm&apos;.&apos;ss}.txt</instruction> <instruction> Call Set Files=&amp;FILES&amp;</instruction> <instruction> Call Set PassedPath=&amp;PATH&amp;</instruction> <instruction> If .%Files%.==.1. (</instruction> <instruction> Call Set TreeParams=/A /F</instruction> <instruction> ) Else (</instruction> <instruction> Call Set TreeParams=/A</instruction> <instruction> )</instruction> <instruction> If Defined PassedPath (</instruction> <instruction> If Not Exist &quot;%PassedPath%\.&quot; (</instruction> <instruction> Call Set BadPath=TRUE</instruction> <instruction> ) Else (</instruction> <instruction> Call Set ReportPath=%PassedPath%</instruction> <instruction> )</instruction> <instruction> )</instruction> <instruction> </instruction> <instruction>:Report</instruction> <instruction> &gt; &quot;%TEMP%\%Filename%&quot; Echo.Date: {Date|yyyy&apos;-&apos;MM&apos;-&apos;yy} {Time|HH&apos;:&apos;mm&apos;:&apos;ss}</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Echo. </instruction> <instruction> If Defined BadPath (</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Echo. Invalid Path Passed!</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Echo. %PassedPath%</instruction> <instruction> ) Else (</instruction> <instruction> &gt;&gt; &quot;%TEMP%\%Filename%&quot; Tree /F %TreeParams% &quot;%ReportPath%&quot;</instruction> <instruction> )</instruction> <instruction> Start /wait &quot;Notepad&quot; Notepad &quot;%TEMP%\%Filename%&quot;</instruction> <instruction> Del /Q &quot;%TEMP%\%Filename%&quot; &gt; Nul</instruction> <instruction> Goto :EOF</instruction> </function> </usercommand>

For much more information see this topic which is where the buttons first came from.

I have problem with that feature. It's generate text with incorrect symbols instead of russian letters what I see in directories.

[code]Date: 2010-03-10 12:22:20

Folder PATH listing for volume Documents
Volume serial number is 98D2-311E
D:\DOWNLOADS!AUDIOBOOKS\Њ€•Ђ€‹ †‚ЂЌ…–Љ€‰
+---_€§ бв а®© Є®««ҐЄжЁЁ
| ‚ иЁ ЇЁбм¬ .mp3
| ‚« бвм е®а®и п ­ த Ї«®е®©.mp3
| ‚л Ї®¦Ё«л.mp3
| €е ¤Ґ­м.mp3[/code]

Which text editor does the resulting list open in ?

Notepad

P.S. Win7 Ult 64-bit, Russian, but with English MUI.

Apparently the Windows command line does not support unicode ... still ...

The "tree" command especially:
stackoverflow.com/questions/1385 ... de-support

Ignoring the failure that is the Windows command line, you could use Opus's built-in Print Folder tool to get a similar output. Set it to use Flat View -> Grouped, within the Print Folder dialog, and make it output to a text file or the clipboard.

Yep, I used this way before. I was hope to get much better way to generate such file lists with this buttons.

Sadly the command doesn't work for me. I use windows 7, Could anybody please check if that could be the problem because. I read the thouroughly the instructions of ken alcock but i can't get the usercommand to work. Please help

OpelOpus, did you seen this topic? PrintTree — User Command

yes i read that topic. I did everyting in the readme file. but when i press at the button when im on a folder it doesn't do anything. What am i doing wrong?

Sorry for double post.

Btw i have "edit pad lite" as default txt handler. Could that be an issue?

Sorry, my link is same that early posted by Leo.

Will back with working solution next time :slight_smile:

I use this one, works fine here :

<?xml version="1.0"?> <button backcol="none" display="both" label_pos="right" textcol="none"> <label>Directory Report</label> <tip>Make a .txt file containing all files in subfolders</tip> <icon1>#index</icon1> <function type="batch"> <instruction>@dirsonly </instruction> <instruction>dir {file$} /S /B /A-D &gt;&quot;{file}.txt&quot;</instruction> </function> </button>

Don't work for me. Nothing happened after pressing this button. Selecting or not selecting dir doesn't change anything.

So... OpelOpus and striimii... you both say that "nothing happens" when you press the different buttons you've each tried (there's a few different suggestions here eh)?

@ striimii when using Devilders button, you should AT LEAST be getting a DOS window popping up for a second - followed by a text file being created in the current folder based on the name of the the folder you've currently got selected. Have you copied the button properly? The commands being run are about as basic as you can get on windows of any version (dir command)...

@ OpelOpus... with the more elaborate button from Ken I suppose there are some more things that could go wrong, there's an OS version check in the beginning that may be causing it to run strangely on Win7. Not sure... does the TREE command work for you from a console prompt?

To both of you, I don't think I've seen either of you mention what about the Opus Print Folder method doesn't also do something useful for you...?

There's a fix in Opus 9.5.3.0 (released today) which may be relevant to Devilder's button:

BTW, looking at Devilder's button I think it needs @nofilenamequoting at the top because it's adding the quotes explicitly and files with a space in them will get two sets of quotes otherwise.

@ steje: No DOS windows appeared while Devilders button work. Yes, I sure that button pasted correctly. Checked twice. If I open DOS Promt and try execute dir command with params it work.