Results 1 to 5 of 5
  1. #1
    AccessPower's Avatar
    AccessPower is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    165

    Determining OS of remote machine in MS Access


    I'm trying to run this command and to get the result passed to a string:

    wmic /NODE:SDJONES1 OS GET Name

    Has anyone here messed around with VBA and the command prompt? I've tried a few things, but nothing seems to return anything properly. It's all numbers or jibberish.

    Thanks
    Last edited by AccessPower; 01-10-2017 at 08:07 AM.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    MsgBox Environ("computername")

  3. #3
    AccessPower's Avatar
    AccessPower is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    165
    I messed up on the title of the post. I'm actually trying to get the OS of a remote machine. Trying to determine if the remote computer has windows 7 or windows 10.

  4. #4
    AccessPower's Avatar
    AccessPower is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    165
    I ended up finding something online and modifying it to pull the OS Version. Thank you again for your help.

    Code:
    Private Sub cmdCheckStatus_Click()    Dim strComputer As String
        Dim objWMIService As Object
        Dim colItems As Object
        Dim objItem As Object
    
    
        strComputer = Me.txtMachine.Value
        
        Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    
    
        Set colItems = objWMIService.ExecQuery( _
            "Select * from Win32_OperatingSystem", , 48)
    
    
        For Each objItem In colItems
            CompName = Nz(objItem.Name, 0)
        Next
            PipePosition = InStr(1, CompName, "|")
            CompName = Left(CompName, PipePosition - 1)
            Me.txtCheckStatus.Value = CompName
        Set objItem = Nothing
        Set colItems = Nothing
        Set objWMIService = Nothing
    End Sub

  5. #5
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Here is a way to list all Environ variables, not sure if one of them contains the OS.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 07-16-2015, 02:14 PM
  2. Replies: 4
    Last Post: 11-29-2012, 12:45 AM
  3. WMIC Info in Access
    By Earl Hood in forum Programming
    Replies: 1
    Last Post: 06-23-2012, 10:00 AM
  4. Replies: 2
    Last Post: 09-01-2011, 01:23 PM
  5. Remote Access
    By treva26 in forum Access
    Replies: 1
    Last Post: 09-03-2009, 06:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums