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. ?
Steve
March 14, 2010, 2:40am
4
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 & 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'-'MM'-'yy}-{Time|HH'.'mm'.'ss}.txt</instruction>
<instruction> Call Set Files=&FILES&</instruction>
<instruction> Call Set PassedPath=&PATH&</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 "%PassedPath%\." (</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> > "%TEMP%\%Filename%" Echo.Date: {Date|yyyy'-'MM'-'yy} {Time|HH':'mm':'ss}</instruction>
<instruction> >> "%TEMP%\%Filename%" Echo. </instruction>
<instruction> If Defined BadPath (</instruction>
<instruction> >> "%TEMP%\%Filename%" Echo. Invalid Path Passed!</instruction>
<instruction> >> "%TEMP%\%Filename%" Echo. %PassedPath%</instruction>
<instruction> ) Else (</instruction>
<instruction> >> "%TEMP%\%Filename%" Tree %TreeParams% "%ReportPath%"</instruction>
<instruction> )</instruction>
<instruction> Start /wait "Notepad" Notepad "%TEMP%\%Filename%"</instruction>
<instruction> Del /Q "%TEMP%\%Filename%" > 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 & 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'-'MM'-'yy}-{Time|HH'.'mm'.'ss}.txt</instruction>
<instruction> Call Set Files=&FILES&</instruction>
<instruction> Call Set PassedPath=&PATH&</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 "%PassedPath%\." (</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> > "%TEMP%\%Filename%" Echo.Date: {Date|yyyy'-'MM'-'yy} {Time|HH':'mm':'ss}</instruction>
<instruction> >> "%TEMP%\%Filename%" Echo. </instruction>
<instruction> If Defined BadPath (</instruction>
<instruction> >> "%TEMP%\%Filename%" Echo. Invalid Path Passed!</instruction>
<instruction> >> "%TEMP%\%Filename%" Echo. %PassedPath%</instruction>
<instruction> ) Else (</instruction>
<instruction> >> "%TEMP%\%Filename%" Tree /F %TreeParams% "%ReportPath%"</instruction>
<instruction> )</instruction>
<instruction> Start /wait "Notepad" Notepad "%TEMP%\%Filename%"</instruction>
<instruction> Del /Q "%TEMP%\%Filename%" > 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]
Steve
March 14, 2010, 9:50am
6
Which text editor does the resulting list open in ?
Notepad
P.S. Win7 Ult 64-bit, Russian, but with English MUI.
Steve
March 14, 2010, 10:32am
8
Apparently the Windows command line does not support unicode ... still ...
Leo
March 14, 2010, 10:44am
9
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
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 >"{file}.txt"</instruction>
</function>
</button>
Don't work for me. Nothing happened after pressing this button. Selecting or not selecting dir doesn't change anything.
steje
March 17, 2010, 1:36am
18
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...?
Leo
March 17, 2010, 9:15am
19
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.