I am trying to query some Windows registry keys through MATLAB. However, on some machines, when I run the following command:
>> [status, CV] = system('REG QUERY "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "ProductId"')
I get the following error:
status = 1 CV =
The system was unable to find the specified registry key or value.
This error is still thrown even when I am logged in as an administrator. However, when I query the same registry key ("ProductId") through the DOS command line:
C:> REG QUERY HKLM\Software\Microsoft\Windows” “NT\CurrentVersion /v ProductId
I have no issues. I can also see the key in the registry (through 'regedit').
Best Answer