I found no answer of my Qs so I'm adding solution..you can give bounty if like it ;)
It's workaround and not exact solution but I think it's good and stable.
There are two parts of answer 1. Handle 32 redirection 2. REG DELETE - to remove key containing backslashes
Part 1
Run 32
%windir%\SysWOW64\reg.exe
Run64 %windir%\sysnative\reg.exe
if you use system32 it will redirect to 32 bit reg when used from 32 bit app so avoid using it. Use sysnative. or disable redirection for temporary
SysNative is valid vista above only
Part 2 : This is complete solution (Qt)
QString reg32 = qgetenv("windir")+"\\SysWOW64\\reg.exe";
QString reg64 = qgetenv("windir")+ "\\sysnative\\reg.exe";
QString command = tr("%1 DELETE \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs\" /v \"%2\" /f")
.arg( is32Bit == true ? reg32 : reg64 )
.arg(key);
QProcess *process = new QProcess(this);
process->start(command);
if (process->waitForStarted())
{
process->waitForFinished();
QString l = process->readAllStandardOutput().simplified();
Logger::Log_Info("RegistryCleaner", command);
if(l.isEmpty())
Logger::Log_Error("RegistryCleaner", "Try again." );
else
Logger::Log_Info("RegistryCleaner", "Successfully done" );
}
else
qDebug() << process->readAllStandardError().simplified();
delete process;