Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7590305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:22:05+00:00 2026-05-30T20:22:05+00:00

As part of my Windows exclusive Java application, I need to query various hardware

  • 0

As part of my Windows exclusive Java application, I need to query various hardware properties – CPU/BIOS/Hard disk serial numbers, and MAC addresses.
So I can use WMIC and other Windows specific tools via a Runtime.exec call.
Querying the CPU and BIOS serial numbers is easy; for example,
wmic BIOS get SerialNumber does the trick.
I haven’t found a similar simple solution to list out MAC addresses.
wmic nic list brief will show me a badly formatted list, but then parsing the output with regex is a pain.

Looking for WMIC related methods all point to some variation of the following VBScript:

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery _ 
("Select * from Win32_NetworkAdapterConfiguration") 
For Each objItem in colItems 
if objItem.IPEnabled = 0 And objItem.ServiceName <> "VMnetAdapter" And isNull(objItem.MACAddress) = 0 Then 
Wscript.Echo objItem.MACAddress   
End if   
Next 

Storing and running the VBS is a security hazard, so what’s currently being done is to write out the VBscript to a text file, execute, then delete it. This is messy and slow.I have used wmic directly for querying other system properties, such as the BIOS serial number.

A pure Java solution would be much better, but I’ve not come across any for all available MAC addresses.
The closest I’ve seen is this, for IP addresses.

Is there a way to do this from Java?
I should add that I’m restricted to using Java 6, though I hear Java 7 has a lot more useful networking APIs.

Update : Forgot to add that NetworkInterface only returns me the IPv4 Ethernet MAC, none of the other virtual adapters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:22:06+00:00Added an answer on May 30, 2026 at 8:22 pm

    What don’t you just try to access WMI from java ? perhaps with jWMI – Query Windows WMI from Java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I'm using ntrights.exe , that is part of Windows Resource Kit
As part of a build setup on a windows machine I need to add
I have windows forms application wich runs another console application here is the part
As part of deployment process, I am starting an .net remoting windows forms application
We have a windows application that contains an ActiveX WebBrowser control. As part of
I have a java application that will run on Windows 7 (using Swing, App
I have a windows service running as part of my application. If I wish
I am writing a website version of a part of our windows application. It's
We have a Windows application written in C++, part of which we are trying
I wrote something to simulate the getopt.h library for a Windows application, and part

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.