Jump to content

Save Folder Structure


Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
Share on other sites

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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...