views:

421

answers:

0

I have tried calling a batch file with elevated permissions. For that I have called fallowing function: (ref - http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx)

ShellExecute(this->GetSafeHwnd(), L"runas", strExecutable, strParams, 0 , SW_SHOW);

The call successfully launches the exexutable, but if I add quotes to my parameters the calling of executable fails. I wanted to add quotes to my parameters to pass file paths having spaces.

The return code of ShellExecute is S_OK. Is there any way to find out what is causing runas to fail?