Question : SNMP script to check systeminfo for uptime on remote xp computer on same lan

i have made a batch script that connects to a remote computer by its ip address and checks its system info
i could really use an SNMP script to do this job would you know a way.
could you explane the steps in the script.
i know there are loads of snmp tools that do this job for you but i need a script
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
@echo off
cls
echo ------------------------------------------------------------------------------
echo IMPORTANT INFO:
echo Patrick Hughes uptime script for computer 2 (192.168.1.12)
echo ------------------------------------------------------------------------------
echo starting system info.......
systeminfo /s 192.168.1.12
pause

Answer : SNMP script to check systeminfo for uptime on remote xp computer on same lan

If all of you PCs are windows based, I'd remcommend that you use Windows Management Instrumentation (WMI) instead of SNMP.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM Win32_OperatingSystem",,48) 
For Each objItem in colItems 
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "Win32_OperatingSystem instance"
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "LastBootUpTime: " & objItem.LastBootUpTime
Next
Random Solutions  
 
programming4us programming4us