buttsnet wrote:
> OK.. so I have this. It does great at counting the number of files in
> c:\temp and it's subfolders. But it pops it up in a msgbox.
>
> What I really need is something that will
> a) read a list of remote computers (e.g., c:\servers.txt)
> b) count the files in a folder (and subfolders) e.g., c:\temp
> c)output all of this to a text file (output.txt) thusly
>
> Server Number of Files
> LukeSky 12
> DarthV 9
> HansSolo 27
> PrincessL 4
>
> etc etc.. here is what I'm starting with.. obviously, I don't know what
> I'm doing. Any help appreciated.
[snip]
To write to a text file, it's like this:
Const ForWriting = 2
Set fo = FSO.OpenTextFile(filename, ForWriting, True)
fo.Write "string"
fo.WriteLine "string"
fo.Close
The args for OpenTextFile are:
1. Filename to open.
2. Mode (read, read, etc).
3. Create file if doesn't exist?
The .WriteLine method automagically adds a newline at the end of the string;
.Write does not.
As for retreiving the server names and whatnot, I have no clue. I'm not real
big on VBS; specifically, I don't know how to do what you need without
calling APIs (which don't work under VBS AFAIK). It might be as simple as:
Set ParentFld = fs.GetFolder ("\\LukeSky\C$\temp")
...but I don't have a Windows server set up to test against.
Unfortunately, I'm pretty sure *everybody* has abandoned this group. You'll
probably get better replies from a forum somewhere on the www.
--
You can cause havoc without being a hacker,
and you can be a hacker without causing havoc.