Question

I'm trying to start my application with my own launcher with administrator rights. The launcher works on my 64Bit Win7 but not at my 32Bit WinXP computer. The code I am using is this:

wstring fullAppPath = "myapp.exe";
ShellExecuteW(NULL,
             L"runas",                       //admin rights
             fullAppPath.c_str(),
             NULL,                           //startup params
             NULL,                           //default dir
             SW_SHOWNORMAL
             );

I use the MSVC 2010 32Bit compiler with the Qt IDE and the launcher-application and the main-application are in the same directory, which is not C:\Windows\System32. On my WinXP computer I get anytime I start my launcher an ERROR_FILE_NOT_FOUND error. (value 2) How can I solve this?

Was it helpful?

Solution

The solution was using an absolute path instead of a relative path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top