Read Values from and to the Registry using Matlab

  • Thread starter Thread starter kartoun
  • Start date Start date
K

kartoun

% Read Values from the Registry

motoman_variables = winqueryreg('name', 'HKEY_CURRENT_USER',
'Uri\Motoman');
setting = winqueryreg('HKEY_CURRENT_USER', 'Uri\Motoman',
motoman_variables{2});
motoman_variables{2}
num2str(setting)

% Write Values to the Registry

Var_1='183';

regFileName = 'G:\Temp\write_reg.reg';
fp = fopen(regFileName,'wt');
fprintf(fp,'REGEDIT4\n');
fprintf(fp,'%s\n','[HKEY_CURRENT_USER\Uri\Motoman]');
fprintf(fp,'%s%s%s%s%s%s\n','"', 'Var_1', '"=', '"', Var_1, '"' );
fclose(fp);

dos('C:\windows\regedit.exe /s G:\Temp\write_reg.reg');

Thanks,

Uri.

http://www.compactech.com/kartoun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top