Sign in to follow this  
Followers 0
Rahul Rohela

Remote system..

4 posts in this topic

Is there is any way to find remoter syatem OS type.. Like its WIndows NT or Windows 2000 or windows XP or 2003????????

Share this post


Link to post
Share on other sites



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.

 

Share this post


Link to post
Share on other sites

$OS = RegRead('\\' & $aComputername & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion','ProductName')

should give you the product name.


----[ SandyD ]---

Share this post


Link to post
Share on other sites

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....

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0