Jump to content

Recommended Posts

Posted

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!!!

Posted

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

Posted

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!!!

Posted

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

Posted

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 :)

<{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

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
×
×
  • Create New...