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);
}
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.
Specify domain
processAdmin.Domain = "domain";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With