locked
Command Prompt Debugger - Debugging Command Line Program RRS feed

  • Question

  • Hello All,

    I am trying to run a program that only runs on the command line via command prompt and I keep getting the below error:

    Error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

    This program worked fine when running on the old Windows 2003 server, but when I moved the program to the new Windows 2012 server, I keep getting the above error.  I have changed permissions on the directories used by this application to include the "Everyone" group, so I do not think that is the issue unless I missed something.  Also, I tried to run "debug" in the command prompt but debug was not found (below).  Using the VS 2013 Developer Command Prompt did not help either, as the same error above occurred without any additional detail.

    C:\>debug
    'debug' is not recognized as an internal or external command,
    operable program or batch file.

    How can I find out where the permission issue is occurring?  Is there a different debugger tool?

    Note: Just a little background on the program - there is one main command and then different options that can be used with the main command.  For example, say the main command is "execute".  When I type execute, I get the list of the options that can be used with the command, like "-r" or "-t".  However, soon as I try to execute the command with one of the options, the error I mentioned above occurs.


    Auburn University Student IT/MIS Intern War Eagle!

    Tuesday, February 2, 2016 3:45 PM

Answers

  • You can check the windows application event log but it is up to the developer as to whether they chose to write an event in this situation. I think the application developer will be your best resource to trouble shoot the issue.

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    • Proposed as answer by Hello_2018 Wednesday, February 3, 2016 2:25 AM
    • Marked as answer by Hello_2018 Wednesday, February 24, 2016 8:08 AM
    Tuesday, February 2, 2016 5:22 PM
  • As Dave mentioned earlier, it might be time to get the developer involved. That is about the only person that can answer the sort of question you are asking. If the developer did not instrument the code to allow for debugging, it gets pretty hard to use typical debugging tools.

    And it is really hard for us to even guess at what the application might be trying to access.  The security model between 2003 and 2012 R2 is significantly different.  2003 was very much the wild west - 2012 R2 is much more locked down.


    . : | : . : | : . tim

    • Proposed as answer by Hello_2018 Wednesday, February 24, 2016 8:06 AM
    • Marked as answer by Hello_2018 Wednesday, February 24, 2016 8:08 AM
    Monday, February 8, 2016 9:33 PM

All replies

  • A couple things you can try opening the cmd.exe session run as administrator, also check the user account control settings. The application developer may also be a good resource. The VS debug location may not be in the system path statement but I'd ask over here about that.

    https://social.msdn.microsoft.com/Forums/vstudio/en-us/home?forum=vsdebug

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Tuesday, February 2, 2016 4:43 PM
  • Hi Dave,

    I tried running cmd as an Administrator and I got the same error as before, with no additional details as to where the error may be occurring.  Is there a tool available on Windows Server 2012 that can help debug this issue?  Is there a setting that I can turn on that would provide a more detailed error message?


    Auburn University Student IT/MIS Intern War Eagle!

    Tuesday, February 2, 2016 5:12 PM
  • You can check the windows application event log but it is up to the developer as to whether they chose to write an event in this situation. I think the application developer will be your best resource to trouble shoot the issue.

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    • Proposed as answer by Hello_2018 Wednesday, February 3, 2016 2:25 AM
    • Marked as answer by Hello_2018 Wednesday, February 24, 2016 8:08 AM
    Tuesday, February 2, 2016 5:22 PM
  • Hi Brain,

    Thanks for posting on the TechNet forum.

    >>Is there a tool available on Windows Server 2012 that can help debug this issue?  Is there a setting that I can turn on that would provide a more detailed error message?

    You could use powershell command: set-psdebug to trace the detailed procedure for the specific command.

    For more information, refer to link below:

    https://technet.microsoft.com/en-us/library/hh849697.aspx

    Besides, Enable Analytic and Debug Logs also is a good choice:

    https://technet.microsoft.com/en-us/library/cc749492.aspx

    Debugging tools:

    https://msdn.microsoft.com/en-us/library/ff551063.aspx

    Additional resource about debug tools:

    http://blogs.technet.com/b/askcore/archive/2008/10/31/how-to-debug-kernel-mode-blue-screen-crashes-for-beginners.aspx

    Best regards,


    Andy_Pan



    • Edited by Hello_2018 Wednesday, February 3, 2016 2:25 AM
    Wednesday, February 3, 2016 2:24 AM
  • Thanks for the reply Andy!  I will try these tools out this week and get back to the thread with the results.

    Auburn University Student IT/MIS Intern War Eagle!

    Thursday, February 4, 2016 3:25 PM
  • Just a quick follow up question - Where do I need to look for the logs in the Event Viewer related to Windows PowerShell and the Command Prompt?

    Auburn University Student IT/MIS Intern War Eagle!

    Thursday, February 4, 2016 3:35 PM
  • Hi All,

    I have tried using Windows PowerShell with "set-psdebug -trace 2" which did not provide any additional detail unfortunately.  I used the Event Viewer but could not locate anything related to the command prompt or the commands I was executing within the command prompt.  "Debug" does not seem to be a command for the command prompt on Windows Server 2012 and I have tried using the Developer Command Prompt located in the Visual Studio Tools folder, but that did not help either.  Also, the developer of this application left the company some years ago, so that resource is not available.

    So, I am still getting the same error as before.  I have tried installing the .DLL files to the GAC but even after that, I am still getting the access denied error.  I have checked permissions on the directories where the application runs and the permissions are correct.

    This is a 32-bit application that now has moved to a 64-bit server.  What could this application be trying to access on the system level that I am getting the below access denied error?

    Error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))


    Auburn University Student IT/MIS Intern War Eagle!

    Monday, February 8, 2016 4:11 PM
  • As Dave mentioned earlier, it might be time to get the developer involved. That is about the only person that can answer the sort of question you are asking. If the developer did not instrument the code to allow for debugging, it gets pretty hard to use typical debugging tools.

    And it is really hard for us to even guess at what the application might be trying to access.  The security model between 2003 and 2012 R2 is significantly different.  2003 was very much the wild west - 2012 R2 is much more locked down.


    . : | : . : | : . tim

    • Proposed as answer by Hello_2018 Wednesday, February 24, 2016 8:06 AM
    • Marked as answer by Hello_2018 Wednesday, February 24, 2016 8:08 AM
    Monday, February 8, 2016 9:33 PM
  • Understood - I will continue to work on this as it is a requirement for this application to be running on the new infrastructure.  If I can get the application working, I will reply to this thread with the solution.

    Auburn University Student IT/MIS Intern War Eagle!

    Tuesday, February 9, 2016 5:07 PM