cscript crashes upon initiating a process from an ASP.NET Application

I encountered an issue with my ASP application. Upon running a process on the server, I started receiving errors from cscript. Oddly enough, when debugging locally everything functions as expected and the process runs smoothly. However, deploying the application to IIS and running it from another machine's explorer results in crashes at the onset of the process.

My initial thought was that it might be related to the user permissions, so I included the following line in the web.config for reassurance:

<identity impersonate="true" userName="domain\user" password="password" />

Additionally, I made sure to add the specified user for the process initiation, but unfortunately, the page continues to crash. The error message I consistently encounter on the server side whenever the process is triggered (via a button press) is:

cscript.exe - Application Error

The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.

The snippet of code responsible for launching the process is as follows:

    public static void updatePerson(csPerson person)
    {

        string fileName = "card.js";

        File.WriteAllText(fileName, person.setFileUpdatePerson(person), Encoding.GetEncoding(1252));


        Process proc = new Process();

        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.CreateNoWindow = true;
        startInfo.UseShellExecute = false;
        startInfo.RedirectStandardOutput = true;
        startInfo.RedirectStandardError = true;
        startInfo.FileName = "cscript.exe";
        startInfo.Arguments = fileName;
        startInfo.WindowStyle = ProcessWindowStyle.Hidden;
        startInfo.UserName = "Administrator";

        SecureString password = new SecureString();
        string pass = "myPassword";
        foreach (char c in pass)
        {
            password.AppendChar(c);
        }

        startInfo.Password = password;
        proc.StartInfo = startInfo;
        proc.Start();
        proc.WaitForExit();
        proc.Close();
        proc.Dispose();
    }

If anyone has insights into what could be causing this issue, I would greatly appreciate your input. I've been grappling with this problem all day.

Thank you.

Answer №1

Make sure to load the user's profile before proceeding

startInfo.LoadUserProfile = true

Update

Consider creating a new application pool using a fresh admin account. If this resolves the issue, remove the user from the admin group and establish a new group with the required permissions for the application.

(refer to resource on running a process in asp.net)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

vue v-if="canEdit" @click.prevent

I have a Vue component called 'test' with specific template and methods. The goal is to make the div clickable only if helper.isEditable is true, otherwise it should be notClickable or touchable. However, I can only retrieve the value of helper. ...

StyledTab element unable to receive To or component attributes

Is there a way to use tabs as links within a styled tab component? I've tried using the Tab component syntax with links, but it doesn't seem to work in this scenario: <Tab value="..." component={Link} to="/"> If I have ...

Adjusting the positioning of the label in a d3 line graph

Here is the data file named: myStData.csv xindex,mylabel 40,23 41,13 42,12 43,21 44,40 45,50 In this code snippet, the label is currently shown at the "start" position (text-anchor set to start). The label is placed according to the start value in the cs ...

What are some techniques for concealing error messages?

Can you assist in resolving this issue? There is a form which displays the inscription "You break my heart" immediately after loading, but I need it to only appear after the user attempts to enter text in the form. <div ng-app=""> <f ...

Utilizing a Grunt task to inject code into an AngularJS file

Hey there! I'm currently looking for a way to add some code into my app.js file that will only execute when I run the "grunt serve" task. This code is just two lines of javascript that should be present when I test the app on my local environment. Unf ...

Validation of clients in ASP.NET

I'm encountering an issue while trying to implement required field validation with a customvalidator. Even when the field is left empty, it still triggers a postback. <body> <form id="Form1" runat="server"> <h3> Cust ...

Error encountered during sequelize synchronization: SQL syntax issue detected near the specified number

Four Sequelize Models were created using sequelize.define();. Each model is similar but with different table names. To avoid manual creation of tables in MySQL cli, the decision was made to use sequelize.sync() in the main index.js file to allow Sequelize ...

Can you explain the meaning behind this syntax?

Currently, I am utilizing Vuetify and I am in the process of getting the server-side controlled data tables up and running. While browsing through the documentation, I stumbled upon this code snippet here. However, I am facing some challenges in understan ...

When the Protractor function is invoked from a Cucumber step definition, it mysteriously returns undefined, despite the fact that the console.log()

Currently, I am in the process of developing an Automation Framework using Protractor-cucumber for the organization I work for. The framework includes several libraries that play crucial roles in its functionality: Protractor Cucumber-js Gulp Chai Chai-a ...

Which is better for creating forms: ASP.NET or Angular.JS?

Good day, I am currently working on creating an internal form for the staff of a blog to submit specific information that will be posted later. The form is being developed in ASP.NET with some Javascript Controls. The issue I am facing is that my server ...

Tips for retrieving nested objects in a get request

A dilemma I'm facing involves a form that effectively sends and saves JSON data to MongoDB using mongoose. However, the issue arises when attempting to access this data as the nested objects display on the get route html page as: { synth: { patch_na ...

Updating a child component in React while applying a filter to the parent component

Although I've come across this question before, I'm struggling to comprehend it within my specific scenario. I'm currently using a search bar to filter the data, which is functioning properly. However, the image is not updating. The URL bei ...

Adding new child entities can be restricted to only `.NET Core Entity Framework` in order

Encountering difficulties while trying to update a parent entity that contains child entities already present in the database. The structure involves a Question entity with a many-to-many relationship with the Answer entity. The simplified model is outlin ...

Ways to detect if a script-blocking ad blocker like Ghostery is preventing a file from loading

I am currently working on a method to detect if ghostery is preventing google doubleclick ad scripts from being loaded. I prefer not to use a listener and instead want a straightforward way to determine if the script or URL is being blocked. Although the c ...

The placement of my image shifts when I switch to the mobile view

Having a small issue with my image alignment. When I switch from portrait to landscape view, the image is no longer centered. The margin remains the same as in portrait view and I'm unsure how to adjust it. I've attempted changing the margins of ...

Is it possible for amCharts to show the data properly?

Starting out with amCharts and javascript can be a bit overwhelming. Here is the structure of my html file: <!DOCTYPE html> <html> <head> <link rel="shortcut icon" href=""> <title>chart created with amCharts | amChar ...

Having trouble with inserting information into MariaDB with Node.js

const mariadb = require('mariadb/callback'); const connection = mariadb.createConnection({ host : 'localhost', user : 'tudublin', password : 'Tudublin@2020', database : 'IOT', timezone: &a ...

What could be causing the failure of isElementPresent function?

Here is a simple code snippet that waits for a dropdown list to be displayed on the page: var By = this.webdriver.By; var driver = this.driver; var bySelector = By.xpath('//*[@id="searchForm"]//*[@class="autocomplete-suggestions autocomplete-suggesti ...

Filter a nested array in AngularJS and retrieve the parent object as the result

I've recently started experimenting with AngularJS to create checkbox filters for my wine store. Here is an example of an item in my store: { "id": 17, "name": "Ermelinda Freitas Reserva", "tag_ids": [40, 12, 56, 6, 60], " ...

Transforming unprocessed string information with a set position-dependent format into a structured format such as JSON

Here is the scenario I am dealing with: The input format consists of a string with a fixed total length, where each set of fixed positions represents a different value. For example, if the input is "ABCDE12345", position 1 to 3 ("ABC" ...