locked
ShellExecute and SE_ERR_ACCESSDENIED? RRS feed

  • Question

  • Dear all,

    When I try to use ShellExecute to open an network drive's directory, I get an error code(SE_ERR_ACCESSDENIED).

    I expected it will pop up the explorer window and ask me to enter the user id and password.

    HINSTANCE h = ShellExecute(NULL, _T("open"), "\\remote\app", NULL, NULL, SW_SHOWNORMAL); // SE_ERR_ACCESSDENIED

    HINSTANCE h = ShellExecute(NULL, _T("explorer"), "\\remote\app", NULL, NULL, SW_SHOWNORMAL); // SE_ERR_ACCESSDENIED

    HINSTANCE h = ShellExecute(NULL, _T("open"), "explorer.exe", "\\remote\app", NULL, SW_SHOWNORMAL); // Popup the explore window, but not the directory that I want.  

    HINSTANCE h = ShellExecute(NULL, _T("open"), "C:", NULL, NULL, SW_SHOWNORMAL); // OK!

    Does anyone know?


    • Edited by Sean Tsai Friday, June 29, 2012 4:02 AM
    Friday, June 29, 2012 3:52 AM

Answers

  • Are you able to access the directory \\remote\app using your Run command? 

    Thanks and Regards Selvam http://www15.brinkster.com/selvamselvam/

    • Proposed as answer by i1friend Monday, July 9, 2012 8:13 AM
    • Marked as answer by Elegentin Xie Friday, July 13, 2012 7:05 AM
    Friday, June 29, 2012 6:52 AM

All replies

  • Under what security context does your application run? Is it running as a service? What are the security settings on \\remote\app?
    Friday, June 29, 2012 4:07 AM
  • Are you able to access the directory \\remote\app using your Run command? 

    Thanks and Regards Selvam http://www15.brinkster.com/selvamselvam/

    • Proposed as answer by i1friend Monday, July 9, 2012 8:13 AM
    • Marked as answer by Elegentin Xie Friday, July 13, 2012 7:05 AM
    Friday, June 29, 2012 6:52 AM
  • Hi Brian,

    How do I check that you said?


    • Edited by Sean Tsai Monday, July 2, 2012 2:08 AM
    Monday, July 2, 2012 2:05 AM
  • Hi Selvam,

    If I use "cmd.exe" to open that directory, it will pop up the window and ask me to enter the id and password.

    That is what I want.


    • Edited by Sean Tsai Monday, July 2, 2012 2:09 AM
    Monday, July 2, 2012 2:08 AM
  • Hi Sean,

    I have marked Selvam's reply as answer.

    If you disagree, please unmark it, and post your doubt.

     

    Regards,

    Elegentin


    Elegentin Xie [MSFT]
    MSDN Community Support | Feedback to us

    Friday, July 13, 2012 7:07 AM