Orca 0 Posted April 5, 2005 How can I select C:\ and return two arrays $dirs[0] containing # of entries $dirs[1-n] containing dir names $files[0] containing # of entires $files[1-n] containing file names I'm trying to build a script that generates a file listing a systems contents in a tree format. If its been done please direct I AM ORCA!! A VERY POWERFUL WHALE!!! Share this post Link to post Share on other sites
buzz44 1 Posted April 5, 2005 I guess you could do something with CMD, Run it in a hidden window, type "Dir" and pipe it out to a file? or if you have the latest beta you can use stdout(). qq Share this post Link to post Share on other sites
Lazycat 13 Posted April 5, 2005 I'm not remember that was exactly solution for dirs, but you can start with this. It's works for files, but can be modified for dirs. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Share this post Link to post Share on other sites
Orca 0 Posted April 5, 2005 CMD is dissabled on the computer I'm interested in running this. The reason for the script is that I'm disallowed from the C:[local] as a user, but autoit can access it just fine. Since I can't normally walk in and view contents I need something that can do it for me. I AM ORCA!! A VERY POWERFUL WHALE!!! Share this post Link to post Share on other sites
buzz44 1 Posted April 5, 2005 Same, I made something exactly the same as this, I didnt have access to C:\ Drive. I created a "File Viewer" in VB but I dont know how to emulate this in AutoIt . qq Share this post Link to post Share on other sites
CyberSlug 6 Posted April 5, 2005 1) Have you seen the DirGetSize function (notice the flag 1 option) 2) There is also the DOS "tree" command... Run(@ComSpec & " /c tree C: /F") ;visually verify the command works Run(@ComSpec & " /c tree C: /F > C:\OutputOfTree.txt") ;redirect to file Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
DaleHohm 65 Posted April 5, 2005 How can I select C:\ and return two arrays$dirs[0] containing # of entries$dirs[1-n] containing dir names$files[0] containing # of entires$files[1-n] containing file namesI'm trying to build a script that generates a file listing a systems contents in a tree format. If its been done please direct <{POST_SNAPBACK}>I'll leave filling the arrays to you, but here is a sample calling out to the FileSystemObject using the ObjCreate function in the new release available from the Developer forum:$fso = ObjCreate("Scripting.FileSystemObject");Instantiate FileSystemObject $rootFolder = "C:\" $root = $fso.GetFolder($rootFolder) $subs = $root.SubFolders; Create SubFolders Collection ConsoleWrite("There are " & $subs.count & " folders in " & $rootFolder & @CR) For $fol in $subs; Loop through each subfolder in folder collection ConsoleWrite(@TAB & $fol.name & " has " & $fol.files.count & " files" & @CR) If $fol.name = "System Volume Information" then ContinueLoop; Special folder, skip $files = $fol.Files; Create files collection in subfolders For $file in $files; Loop through files in folders ConsoleWrite(@TAB & @TAB & $file.name & " (" & $file.size & " bytes)" & @CR) Next Next Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Share this post Link to post Share on other sites