in asp.net c# Process.start not working after publish in IIS local host

partha brave 1 Reputation point
2021-06-13T12:48:21.633+00:00

code is
System.Diagnostics.Process.Start(@"\web1\");

Error is
Exception Details: System.ComponentModel.Win32Exception: Access is denied

Stack Trace:

[Win32Exception (0x80004005): Access is denied]
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) +1091
System.Diagnostics.Process.Start(ProcessStartInfo startInfo) +60
_Default.Button1_Click(Object sender, EventArgs e) +22
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

I have tried application pool identity set as localservice and then
In IIS ADMIN Service enabled the allow service to interact with desktop

Developer technologies ASP.NET ASP.NET Core
Developer technologies ASP.NET Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2021-06-13T16:15:14.46+00:00

    You can not process start a folder. Also as it’s a network share, the process must be running as a domain account with access to the share.

    0 comments No comments

  2. Sam Wu-MSFT 7,561 Reputation points Microsoft External Staff
    2021-06-14T06:21:01.533+00:00

    @partha brave

    This is a problem caused by permissions, you can try the following methods to solve the problem.

    In IIS Manage->Pool Application->Advance Setting->Identity change ApplicationPoolIdentity to Custom Account and set Administrator User.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Paulo Viana 0 Reputation points
    2024-04-02T17:06:48.7866667+00:00

    Solution

    In IIS Manage->Pool Application->Advance Setting->Identity change ApplicationPoolIdentity to Custom Account and set Administrator User.

    Set user to access network

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.