Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stub received bad data?

Tags:

c#

Firstly, there is no problem executing the code on Win7/Win8 etc. The problem exists solely on Windows XP. The code is in a button, and basically runs taskmgr.exe as another users credentials (a local admin credentials, this is a Kiosk PC which loads a C# application which can be logged into and then load cmd.exe/taskmgr.exe as a local admin unaffected by the GPOs linked to the Kiosk user).

However, on XP, I get the error when clicking the button: Stub received bad data.

Code:

private void btnTaskMgr_Click(object sender, EventArgs e)
{
    string password = "myPassword";
    SecureString secureString = new SecureString();

    foreach (char chr in password) secureString.AppendChar(chr);

    ProcessStartInfo processAdmin;
    processAdmin = new ProcessStartInfo();
    processAdmin.UseShellExecute = false;
    processAdmin.Password = secureString;
    processAdmin.UserName = "admin";
    processAdmin.FileName = "taskmgr.exe";
    processAdmin.WorkingDirectory = "C:\\Windows\\System32";
    Process.Start(processAdmin);

}

enter image description here

like image 784
PnP Avatar asked Sep 15 '13 00:09

PnP


People also ask

What does the stub received bad data mean?

1] Error 1783: The stub received bad data According to Microsoft Documents, it happens when the number of services installed has exceeded the size limit of the Services.


1 Answers

Specify domain

processAdmin.Domain = "domain";

like image 113
Shahid Hazoor Avatar answered Sep 28 '22 18:09

Shahid Hazoor