Orca Posted April 5, 2005 Share 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!!! Link to comment Share on other sites More sharing options...
buzz44 Posted April 5, 2005 Share 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 Link to comment Share on other sites More sharing options...
Lazycat Posted April 5, 2005 Share 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]) Link to comment Share on other sites More sharing options...
Orca Posted April 5, 2005 Author Share 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!!! Link to comment Share on other sites More sharing options...
buzz44 Posted April 5, 2005 Share 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 Link to comment Share on other sites More sharing options...
CyberSlug Posted April 5, 2005 Share 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! Link to comment Share on other sites More sharing options...
DaleHohm Posted April 5, 2005 Share 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, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now