Rahul Rohela Posted June 14, 2006 Share Posted June 14, 2006 Is there is any way to find remoter syatem OS type.. Like its WIndows NT or Windows 2000 or windows XP or 2003???????? Link to comment Share on other sites More sharing options...
GaryFrost Posted June 14, 2006 Share Posted June 14, 2006 MsgBox(0,"OS",OSInfo(@ComputerName)) Func OSInfo($s_Machine) Local Const $wbemFlagReturnImmediately = 0x10 Local Const $wbemFlagForwardOnly = 0x20 Local $colItems = "", $objItem, $s_info Local $objWMIService = ObjGet("winmgmts:\\" & $s_Machine & "\root\CIMV2") If @error Then MsgBox(16, "_RetieveOSInfo", "ObjGet Error: winmgmts") Return EndIf $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If @error Then MsgBox(16, "_RetieveOSInfo", "ExecQuery Error: SELECT * FROM Win32_OperatingSystem") Return EndIf $s_info = "System:" & @CRLF & @TAB If IsObj($colItems) Then For $objItem In $colItems Local $name = StringSplit($objItem.Name, "|") $s_info = $s_info & $name[1] & @CRLF & @TAB $s_info = $s_info & "Version " & $objItem.Version & @CRLF & @TAB $s_info = $s_info & "Service Pack " & $objItem.ServicePackMajorVersion & @CRLF & @CRLF $s_info = $s_info & "Registered to:" & @CRLF & @TAB $s_info = $s_info & $objItem.RegisteredUser & @CRLF & @TAB $s_info = $s_info & $objItem.Organization & @CRLF & @TAB $s_info = $s_info & $objItem.SerialNumber & @CRLF & @CRLF Next EndIf Return $s_info EndFunc SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
sandyd Posted June 14, 2006 Share Posted June 14, 2006 $OS = RegRead('\\' & $aComputername & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion','ProductName') should give you the product name. ----[ SandyD ]--- Link to comment Share on other sites More sharing options...
Rahul Rohela Posted June 15, 2006 Author Share Posted June 15, 2006 MsgBox(0,"OS",OSInfo(@ComputerName)) Func OSInfo($s_Machine) Local Const $wbemFlagReturnImmediately = 0x10 Local Const $wbemFlagForwardOnly = 0x20 Local $colItems = "", $objItem, $s_info Local $objWMIService = ObjGet("winmgmts:\\" & $s_Machine & "\root\CIMV2") If @error Then MsgBox(16, "_RetieveOSInfo", "ObjGet Error: winmgmts") Return EndIf $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If @error Then MsgBox(16, "_RetieveOSInfo", "ExecQuery Error: SELECT * FROM Win32_OperatingSystem") Return EndIf $s_info = "System:" & @CRLF & @TAB If IsObj($colItems) Then For $objItem In $colItems Local $name = StringSplit($objItem.Name, "|") $s_info = $s_info & $name[1] & @CRLF & @TAB $s_info = $s_info & "Version " & $objItem.Version & @CRLF & @TAB $s_info = $s_info & "Service Pack " & $objItem.ServicePackMajorVersion & @CRLF & @CRLF $s_info = $s_info & "Registered to:" & @CRLF & @TAB $s_info = $s_info & $objItem.RegisteredUser & @CRLF & @TAB $s_info = $s_info & $objItem.Organization & @CRLF & @TAB $s_info = $s_info & $objItem.SerialNumber & @CRLF & @CRLF Next EndIf Return $s_info EndFunc This script is working fine... IS there is any other way to find OS type without use of WMI... As to run above script sucessfully remote system admin access is required... and for the network having diffrent local admin passwords its hard to run it.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now