Im attempting to kill a process remotely by using pskill.
From the command line, pskill works great, but when trying the same command in C# Im getting an access denied error.
var startInfo = new ProcessStartInfo {
FileName = "pskill.exe",
Arguments = "-t \\" + _currentMachine +
" -u BobSmith -p Pass123 " + _currentService +
" /acceptEULA"
};
try {
using (Process exeProcess = Process.Start(startInfo)) {
exeProcess.WaitForExit();
}
} catch {
Console.WriteLine("Cannot forcibly kill process.");
}
I have even tried creating a .bat file which runs fine manually but I get the same error when trying to call the .bat from C#.
Im on an XP machine attempting to access a win 2003 server.