Question : Convert VBS to HTA

Hi Coders!
Would like the following vbs be converted to an hta.  Would also like the ping to be changed to a wmi ping.

 Would like a fill box to take the place of:
Set List = objFSO.OpenTextFile("c:\list.txt", ForReading) -- >> path of computer list

And instead of results going to:
Set Out = objFSO.CreateTextFile("c:\log.txt", ForWriting) -- >> path of the report\log.txt
would like results to be displayed once complete.

Any recommended improvement welcomed...
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set List = objFSO.OpenTextFile("c:\list.txt", ForReading)
Set Out = objFSO.CreateTextFile("c:\log.txt", ForWriting)
 
Do Until List.AtEndOfStream
	strComputer = List.ReadLine
	If Reachable(strComputer) Then
		Out.WriteLine strComputer
		Out.WriteLine "**********"
		Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
		For Each objUser In objGroup.Members
			Out.WriteLine objUser.Name 
		Next
		Out.WriteLine VbCrLf
	Else
		out.WriteLine strComputer & " IS Unreachable !"
	End If
Loop
	
	Function Reachable(strComputer)
		strCmd = "ping -n 1 " & strComputer
		 
		Set objShell = CreateObject("WScript.Shell")
		Set objExec = objShell.Exec(strCmd)
		strTemp = UCase(objExec.StdOut.ReadAll)
		 
		If InStr(strTemp, "REPLY FROM") Then
			Reachable = True 
		Else
			Reachable = False
		End If
	End Function
Open in New Window Select All

Answer : Convert VBS to HTA

Try this.

Regards,

Rob.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:

Enumerate Local Administrators Group on Remote Computers





 



Open in New Window Select All
Random Solutions  
 
programming4us programming4us