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 6577083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:35:30+00:00 2026-05-25T15:35:30+00:00

I am having trouble with permissions on Windows 2008 server. i have a command

  • 0

I am having trouble with permissions on Windows 2008 server. i have a command line utility that I need to run to convert some standard files to CSV files. That are in turn used to import data to my SQL database. I am able to get the done to work fine on my 2003 server but my windows 2008 server is not allowing the code to run. Below is a watered down version of the code. Basically in this example I am just trying to run a simple command. But I keep getting the output access denied. How do I correct this?

public partial class _Bank : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}


protected void btn_Click(object sender, EventArgs e)
{

    ProcessStartInfo processStartInfo = new ProcessStartInfo("cmd.exe");
    processStartInfo.RedirectStandardInput = true;
    processStartInfo.RedirectStandardOutput = true;
    processStartInfo.UseShellExecute = false;
    processStartInfo.RedirectStandardError = true;  

    Process process = Process.Start(processStartInfo);

    if (process != null)
    {

       process.StandardInput.WriteLine("dir");

       process.StandardInput.Close();
       string outputString = process.StandardOutput.ReadToEnd();
       Response.Write(outputString);

       string error = process.StandardError.ReadToEnd();
       Response.Write(error);

    }

}
private string ProcessRunner()
{
    ProcessStartInfo processStartInfo = new ProcessStartInfo("cmd.exe");
    processStartInfo.RedirectStandardInput = true;
    processStartInfo.RedirectStandardOutput = true;
    processStartInfo.UseShellExecute = false;

    Process process = Process.Start(processStartInfo);

    if (process != null)
    {

        //process.StandardInput.WriteLine("This is a test line");
        process.StandardInput.WriteLine("c:\\");
        process.StandardInput.WriteLine("This is a test line");

        process.StandardInput.Close(); // line added to stop process from hanging on     ReadToEnd()

        string outputString = process.StandardOutput.ReadToEnd();
        Response.Write(outputString);
        return outputString;

    }

    return string.Empty;
}

public static int ExecuteCommand(string Command, int Timeout)
{
    int ExitCode;
    ProcessStartInfo ProcessInfo;
    Process Process;

    ProcessInfo = new ProcessStartInfo("cmd.exe", "/C " + Command);
    ProcessInfo.CreateNoWindow = true;
    ProcessInfo.UseShellExecute = false;
    Process = Process.Start(ProcessInfo);
    Process.WaitForExit(Timeout);
    ExitCode = Process.ExitCode;
    Process.Close();

    return ExitCode;
}
}
  • 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-25T15:35:31+00:00Added an answer on May 25, 2026 at 3:35 pm

    This is running within an asp.net application with an App-Pool. The App-Pool has an identity (LocalSystem, Network Service etc) this process is executed.
    Make sure that this user does have the necessary privileges on the folders you are planning to access.

    IMHO: for security reasons starting another process within a web application is not best practice and should never be done on internet web applications.

    EDIT:
    Usualy the user is named ASPNET or IWAM_[Servername] (IWAM_… Built-in account for Internet Information Services to start out of process applications). Just give access to the folder to that user.

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

Sidebar

Related Questions

I'm having trouble with SQL Server 2008 (Express with Advanced Services) Reporting Services permissions.
Very simple question that I've been having trouble answering. In Windows XP and Server
I am having trouble granting reverse permissions for apps that I wish to provide
So I'm making a debian package, but I'm having trouble with doing some permissions
I'm having trouble deploying my Web start to the web server due to permissions
Good day all, I am having some trouble with image permissions. I am loading
I have a mobile application that I'm using with Facebook connect. I'm having trouble
I'm having some trouble defining permissions for my albums#index action. The path to it
I'm having trouble seeing tables from one particular SQL Server 2008 database while trying
I am having some trouble when publishing an MVC application to a server, and

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.