Set wshNetwork = WScript.CreateObject("Wscript.Network")
'設定電腦名稱參數,供追蹤使用
strComputerName =wshNetwork.ComputerName
Set objFSO = CreateObject("Scripting.FileSystemObject")
'將問題檔案資訊及該台電腦名稱,紀錄於\\PublicFolder公用資料夾中
If objFSO.FileExists("c:\bugex1.dll") Then
set objFile = objFSO.CreateTextFile("\\Publicfolder\" & strComputerName & "_bugex1")
Wscript.Echo "Found Bugex1 !"
'查其他問題檔案
Elseif objFSO.FileExists("c:\bugex2.xd") then
set objFile = objFSO.CreateTextFile("\\Publicfolder\" & strComputerName & "_bugex2")
Wscript.Echo ""Found Bugex2 !""
else
Wscript.Echo "Congratulation! Bugs not Found ^_^.."
End If
set wshNetwork = nothing
set strComputerName =nothing
set objFSO = nothing
set objFile = nothing
WScript.Sleep 3000
Wscript.Quit