Sign in to follow this  
Followers 0
shaahin

Save Folder Structure

9 posts in this topic

hello

I want to make a program to save a drive structure (with all files and folders in all levels) in a text file (and also show it in a treeview) that i can load it later for compare .

I need somthings like 'Folder Bar' in 'My Computer' (Include files).

I can do that for first level of drive, my problem is subfolders and other levels.

Sombody here can help me?

I wrote a simple example (Without Save\Load Function). i Hope it help other to understand what i need.

I am waiting...

here is my simple code:

#include <GUIConstants.au3>
#Include <File.au3>
#Include <Array.au3>
#Include <GuiTreeView.au3>
$FileList=_FileListToArray("c:\","*.*",0)
GUICreate("")
GUISetState()
$tview=GUICtrlCreateTreeView(0,0,400,400)
for $i= 1 to $filelist[0]
    $Folder=GUICtrlCreateTreeViewItem($filelist[$i],$tview)
    searchinside("D:\"&$filelist[$i]&"\")       
Next



While 1
     $msg=GUIGetMsg()
    if  $msg=$GUI_EVENT_CLOSE then Exit
WEnd


func searchinside($searchstring)
$FileList2=_FileListToArray($searchstring,"*.*",0)
        if IsArray($filelist2) Then
            for $j=1 to $FileList2[0]
            $Folder2=GUICtrlCreateTreeViewItem($filelist2[$j],$Folder)
            Next    
        EndIf   
EndFunc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

hello

I want to make a program to save a drive structure (with all files and folders in all levels) in a text file (and also show it in a treeview) that i can load it later for compare .

I need somthings like 'Folder Bar' in 'My Computer' (Include files).

I can do that for first level of drive, my problem is subfolders and other levels.

Sombody here can help me?

I wrote a simple example (Without Save\Load Function). i Hope it help other to understand what i need.

I am waiting...

here is my simple code:

#include <GUIConstants.au3>
#Include <File.au3>
#Include <Array.au3>
#Include <GuiTreeView.au3>
$FileList=_FileListToArray("c:\","*.*",0)
GUICreate("")
GUISetState()
$tview=GUICtrlCreateTreeView(0,0,400,400)
for $i= 1 to $filelist[0]
    $Folder=GUICtrlCreateTreeViewItem($filelist[$i],$tview)
    searchinside("D:\"&$filelist[$i]&"\")       
Next
While 1
     $msg=GUIGetMsg()
    if  $msg=$GUI_EVENT_CLOSE then Exit
WEnd
func searchinside($searchstring)
$FileList2=_FileListToArray($searchstring,"*.*",0)
        if IsArray($filelist2) Then
            for $j=1 to $FileList2[0]
            $Folder2=GUICtrlCreateTreeViewItem($filelist2[$j],$Folder)
            Next    
        EndIf   
EndFunc
Looks like the same topic, and the same lines of code as http://www.autoitscript.com/forum/index.ph...st&p=245353

Edit:

Is that the same thing you are trying to do?

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi,

what something like this:

RunWait(@ComSpec & ' /c tree c:\  /F /A > c:\tree.txt', '', @SW_HIDE)

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

1- yes it is, i need that till yet.

2-thx th.meger. i tested it before, but i want to save it for use it later in a TreeView?

do u have good idea for do that? (i mean c:\tree.txt file in TreeView control?

Share this post


Link to post
Share on other sites

HI,

why do you want to have it in a treeview. Above you mentioned that you need it to compare. It is much easier to compare txt-files than treeview, I suppose.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

yeah.

it's hard to explain, but i want to browse the structure and select, everywhere i want and then compare it.

is it impossible to create a folder structure in Autoit?

other programmers how do that in Delphi or ...?

i mean if they want create it manually(Not use native Delphi controls)

thx

Share this post


Link to post
Share on other sites

hey ...

really there is no way?

Share this post


Link to post
Share on other sites

OK. I think there is no way ...

Cool

Share this post


Link to post
Share on other sites

HI,

surely there is a way, but it is a long way to go - and I don't why I should go it. :lmao:

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0