none
CreateProcess() failed and returned 'Access is denied' when launching IE with parameters under Win7

    Question

  • Hi all,

    Under Windows 7, with IE 8.

    The first piece of code failed to launch an IE to google, but the second one succeeded with a blank IE. The only difference is the command line.

    Under XP with IE 6, both succeeded.

    ------------------------------------#1---------------------------------

    PROCESS_INFORMATION pi = {0};
    STARTUPINFOW si = {0};
    ZeroMemory(&si,sizeof(si));
    si.cb = sizeof(si);
    
    bool succeeded = CreateProcessW(
     NULL,
     L"C:\\Progra~1\\Intern~1\\IEXPLORE.EXE http://www.google.com",
     NULL,
     NULL,
     false,
     0,
     NULL,
     NULL,
     &si,
     &pi
    );
    

    ------------------------------------#2---------------------------------

    PROCESS_INFORMATION pi = {0};
    STARTUPINFOW si = {0};
    ZeroMemory(&si,sizeof(si));
    si.cb = sizeof(si);
    
    bool succeeded = CreateProcessW(
     NULL,
     L"C:\\Progra~1\\Intern~1\\IEXPLORE.EXE",
     NULL,
     NULL,
     false,
     0,
     NULL,
     NULL,
     &si,
     &pi
    );
    

    ---------------------------------------------------------------------

    Any idea?

    My program has to run on XP, so I don't want to use some APIs only running on Windows 7.

    Best regards,

    • Edited by Zach_Shine Thursday, September 30, 2010 6:31 AM Format code
    Thursday, September 30, 2010 6:29 AM

Answers