Share via


Windows 10 getmac error invalid class

Question

Tuesday, November 15, 2016 9:34 AM

Hello there,

I'm an IT technician in company and I have encountered and issue with one of our employees Windows 10 PC.

He need to you for his programming the command 'getmac' and its not working and getting the "error: invalid class".

I tried to run SFC /scannow and dism /restore and it fixed some errors but still it didn't solve this issue.

Please assist.

Thanks,

Aviad

All replies (3)

Tuesday, November 15, 2016 10:09 AM

If he is a programmer or a scripter and the planned approach does not even work on his own machine he might consider another approach like ipconfig or Powershell with a wmi cmdlet.

Grüße - Best regards

PS:> (79,108,97,102|%{[char]$_})-join''


Tuesday, November 15, 2016 11:42 AM

Never mind i fixed it .

The problem was in WMI.

I used this solution.

  1. Disable and stop the winmgmt service
  2. Remove or rename C:\Windows\System32\wbem\repository
  3. Enable and start the winmgmt service
  4. Open a CMD prompt as Administrator
  5. In the CMD prompt Navigate to C:\Windows\System32\wbem\
  6. Run the following command:

for /f %s in ('dir /b *.mof') do mofcomp %s

Note: This will take a minute or so to complete.

  1. Now run the command:

for /f %s in ('dir /b en-us\.mfl') do mofcomp en-us\s


Wednesday, November 16, 2016 6:31 AM

Hi Aviad26,

I am glad the issue has been resolved and thanks for updating. Please remember to mark reply. It will be very useful as a reference for the person who will come across the similar issue in the future.

Best regards

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].