Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6366749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:27:41+00:00 2026-05-25T00:27:41+00:00

Bellow is my code from asp.net service which is trying to run some external

  • 0

Bellow is my code from asp.net service which is trying to run some external exe. It works fine from my Visual Studio on win 7, but fails on my server (server 2008).
Myapp.exe reports back eror that account under which is runned doesn’t have sufficiet priviliges.

    List<ProcInfo> allProcesses = new List<ProcInfo>();            
    ProcessStartInfo pInfo = new ProcessStartInfo();
    pInfo.FileName = binPath + @"\myApp.exe";
    pInfo.WindowStyle = ProcessWindowStyle.Hidden;
    pInfo.CreateNoWindow = true;
    pInfo.UseShellExecute = false;
    pInfo.RedirectStandardOutput = true;

    string exitMsg = "";
    int exitCode = 1;
    try
    {
        using (Process proc = Process.Start(pInfo))
        {
            exitMsg = proc.StandardOutput.ReadToEnd();
            proc.WaitForExit(1000);
            exitCode = proc.ExitCode;
        }
    }

Resource pool on the server runs under account with sufficient priviliges and I also tried to use same account in code to start service with those same credentials and still nothing.

I have been told that account under which asp.net worker thread runs impose some additional limitations. So even if resource pool runs under appropriate account, you still won’t have sufficient priviligies.
I also found something about using pInvoke and win32 api calls as the only way to run external code from asp.net service. But I don’t have any win32 api knowlege nor did I found exples of this.

I would be very grateful for any tip/example how to run external exe under specified account from asp.net service.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:27:42+00:00Added an answer on May 25, 2026 at 12:27 am

    If the account the worker process is runnning under lacks sufficient privelages then you have a few options.

    You can either use impersonation in your code:

    WindowsIdentity.Impersonate Method

    Or configure IIS to run the application under a user account with the required privileges.

    Here is an article which explains different methods of impersonation security:

    Understanding ASP.NET Impersonation Security

    If you do not feel confident implementing the user impersonation code yourself, here is a link to a codeproject article:

    A small C# Class for impersonating a User

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying connect to MySQL database from ASP.net code. some my connection is
I am trying to use a web service built on asp.net wcf from iPhone
I am trying to call some web services written in Java from my asp.net
I am trying to restart Windows Time Service from my asp.net application using the
I am trying to use the below code to send email from asp.net(C#). using
I have to convert some code from classic ASP to ASP.NET 1) How can
I use the bellow code to load the main menu elements from some CMS,
I am trying to make an HttpWebRequest from an ASP.Net page on a server
I use code below to send file from ASP.NET Rest Api to client. Sometimes
I try to port ASP .NET MVC2 password recovery code from Where to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.