![]() |
|
|||||||
| ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum? |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a script that gather's some info on a remote pc. It reads from a text file and then writes to another file w/ the info. Some PC's are offline and instead of just "On Error Resume Next" I would like to send a message after it writes the strComputer name and say something like "Systen Now Offline".
Cannot seem to get it. Here's the code. Thanks! On Error Resume Next DIM fso, IPAKFile Set fso = CreateObject("Scripting.FileSystemObject") Set IPAKFile = fso.CreateTextFile("IPAK_query.txt", True) Const HKEY_LOCAL_MACHINE = &H80000002 Set InputFile = fso.OpenTextFile("MachineList.Txt") Do While Not (InputFile.atEndOfStream) strComputer = InputFile.ReadLine Set oReg=GetObject("winmgmts:{impersonationLevel=imper sonate}!\\" & _ strComputer & "\root\default:StdRegProv") IPAKFile.WriteLine("Computer Name: ") &strComputer If Err.Number <> 0 Then IPAKFile.WriteLine("System is Offline") End If On Error GoTo 0 strKeyPath = "SOFTWARE\Company\Client Image" strValueName = "CurrentVersion" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e IPAKFile.WriteLine("Current TCO Image Version: ") & strValue strValueName = "Edition" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e IPAKFile.WriteLine("OS Edition: ") & strValue strValueName = "InstallDate" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e IPAKFile.WriteLine("Install Date: ") & strValue strValueName = "InstallVersion" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e IPAKFile.WriteLine("Current Install Version: ") & strValue strValueName = "ServicePack" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e IPAKFile.WriteLine("Current Service Pack: ") & strValue strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninsta ll\tcoo2kpatch" strValueName = "DisplayName" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e IPAKFile.WriteLine("Current TCO Office Updater Version: ") & strValue IPAKFile.WriteLine(".............................. ...................") Loop Wscript.Echo "Done" |
|
This ad is part of our Revenue Sharing program |