Trouble writing Path to registry



hi everyone,
i like to write two paths from edit-fields to the registry using the
following code:

write:
regFile='write_reg.reg';
Dir1 = '[HKEY_CURRENT_USER\Zamomo\PlotDeviation\]';
dirValue = get (handles.EDIT_DIR, 'String');
fileValue = get (handles.EDIT_FILE, 'String');
fp = fopen(regFile,'wt');
fprintf(fp,'REGEDIT4\n');
fprintf(fp,'%s\n',Dir1);
fprintf(fp,'"MatDir"="%s"\n"FileName"="%s"\n', dirValue, fileValue);
fclose(fp);
dos('regedit.exe /s write_reg.reg');
delete ('write_reg.reg');

read:
dirName = winqueryreg('HKEY_CURRENT_USER', 'Zamomo\PlotDeviation\',
'MatDir');
fileName = winqueryreg('HKEY_CURRENT_USER', 'Zamomo\PlotDeviation\',
'FileName');
dirName = num2str(dirName)
fileName = num2str(fileName)
set (handles.EDIT_DIR, 'String', dirName);
set (handles.EDIT_FILE, 'String', fileName);

However, if the path includes a "\" it isnt written to the registry.
Other Strings are written completely fine. I use matlab 7.3 on a
windows2000 machine. Any ideas?
Thanx in advance, Jan
.



Relevant Pages