|
-
Sep 12th, 2008, 03:08 PM
#1
Thread Starter
Junior Member
VBscript to Find a File on a Network then output the Results to txt
Essentially, this is what I am aiming to do with a vbscript:
1) It reads a text file that has all computer bios names in it
2) When it reads it it then will look for a filename I choose located in a folder I choose also (ie. c:\windows\test.bak) -- this is on the remote PC
3) If it finds the file, it dumps the result to a text file (which I chose its location and name) with the name of the machine and the resulting file it found (all on the same line). This is done over, say, MANY machines that dump the file to a single output text as it scans the list from #1.
4) If it doesn't find the file OR the network path isn't found to the machine in question, it should report this in the output file listing machine name and reporting "not found" on the same line.
5) As a bonus: is it possible to set a TIMEOUT of, say, 10sec, that if it doesn't poll a result from #1 that it then just moves to the next bios name from #1?
I got #1 completed:
Code:
on error resume next
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("c:\systemlist.txt", ForReading)
Wscript.echo objtextfile
' *************************************************************
' create the input array
strText = objTextFile.ReadAll
objTextFile.Close
arrComputers = Split(strText,vbcrlf)
' *************************************************************
.. but the rest I am clueless. It will read from "c:\systemlist.txt" just fine.
Thanks Vbforums community.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|