this may not be what you're looking for. It doesn't use OLE, but unless WSH files and folders are different it should do the job with some modifications.

This code takes a windows path and writes to c:\log.txt the contents of the given directory and all its subdirectories

Please feel free to comment on this code as I'm sure its not perfect.
#!/Perl/bin/perl use IO::File; use strict; print "Enter the directory to map: "; my $dir = <STDIN>; chomp($dir); my $log = new IO::File; $log->open(("> c:\\log.txt")) or die "$!"; $log->write("Map of: ".$dir,length("Map of: ".$dir)); $dir =~ s{\\}{\\\\}g; mapMe($dir); $log->close; ##Recursive routine to print out all the files & folders under a given + root node sub mapMe { #Get the parameter my $handle = shift; #Open the directory passed to the subroutine opendir(SPROUT,$handle); #read the entries my @entries = readdir(SPROUT); #Close the directory closedir(SPROUT); my $log_entry; #Start @ 2 to skip . & .. entries foreach my $i (2..scalar(@entries)) { #Format the handle for the next call my $param_handle = $handle."\\".$entries[$i]; #If its a directory and its not null if(opendir(TEST,$param_handle) and $entries[$i]) { #Close the directory closedir(TEST); #Strip the handle for log writing purposes $handle =~ s{\\\\}{\\}g; #Construct and write the log $log_entry = "\n".$handle."\\".$entries[$i]."\n"; $log->write($log_entry,length($log_entry)); #recurse the directory mapMe($param_handle); } elsif($entries[$i]) { #Construct and write the log $log_entry = "*".$entries[$i]."\n"; $log->write($log_entry,length($log_entry)); } } }
I hope this will help you out.

In reply to Re: Re: Windows Scriptin Host & OLE. by Grygonos
in thread Windows Scriptin Host & OLE. by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.