So, I have to fix this VB6 application A, which launches B.exe through the Shell command (Shell(strCmd)) along with C.exe args as its arguments. B.exe will launch C.exe with args as its arguments.
This VB6 application works under Windows XP and Windows 7 with the lowest UAC settings. However, under Windows 7 with default UAC settings (second notch from the highest), C.exe produces an error. When I ran C.exe without elevated privileges, I get the same error.
My question is:
If I ran A as an administrator, does B.exe run as an administrator if it was executed through the Shell command in A?
If not, what are my options without making changes to B.exe and C.exe? Without prompting the user for password in the middle of run-time if possible?
Shell()does not change the privilige or execution level. If an executable is running elevated then any sub processes will also be elevated.If you want to run a process elevated from an unelevated process, you will need to use
ShellExecute()with therunasverb.It’s not possibly to (directly) start a process unelevated from an elevated one.