Carly Posted April 4, 2003 Posted April 4, 2003 I am running a simple VB.NET program that kills a process, winword.exe. It works fine on all machines except a Windows 2000 Terminal Server. I get the error below: Can anyone suggest anything? The code I used is here: msdn.microsoft.com/library/default.asp?url=/library/en-us/ cpref/html/frlrfsystemdiagnosticsprocessclassgetprocessesbynametopic1.asp ************* Exception Text ************** System.ComponentModel.Win32Exception: Access is denied at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.get_HasExited() at WindowsApplication8.Form1.Button1_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Quote
*Experts* Volte Posted April 4, 2003 *Experts* Posted April 4, 2003 Does the user that you are logged in as (in Windows) have the appropriate permissions to do that (as in kill other processes)? Quote
Carly Posted April 4, 2003 Author Posted April 4, 2003 Yes, I am an administrator on the Domain. Quote
*Experts* Volte Posted April 4, 2003 *Experts* Posted April 4, 2003 Well, I don't know much about W2K Terminal Server, but it might have some sort of protection against processes killing other processes. Quote
*Experts* Nerseus Posted April 4, 2003 *Experts* Posted April 4, 2003 Is the machine just a terminal-service enabled computer, or do you mean you are using terminal services to connect remotely to another machine and through that connection, trying to run a program that is trying to kill a process? Did you try the overload that takes the machine name and try and run the program for your client machine and connect to the remote machine (instead of connecting through terminal services and running the program locally on the remote machine)? As long as the user you are connecting as is an admin on that machine, I wouldn't think you'd get an Access Denied message. Is that machine on the same domain as the Domain Admin you're connecting as? Meaning, are you connecting to a machine on another domain? Have you tried logging onto the remote machine as a local admin (local to that machine)? -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Carly Posted April 4, 2003 Author Posted April 4, 2003 It is a Windows 2000 Server running Terminal Services, which has about 30 users running a terminal session. The program is being run from a directory on that machine. I think the problem may be that my program doesnt know which processes are mine and tries to access other users processes. Quote
melegant Posted April 7, 2003 Posted April 7, 2003 Terminal Server Applications (at least those set to be used by multiple people) run a bit differently than those on a standard W2K box. http://www.microsoft.com/windows2000/en/server/help/default.asp?url=/windows2000/en/server/help/sag_termsrv_topnode.htm This may help. Also, are you able to kill the exe with a standard end task from the task manager?> Quote
sdevry Posted November 19, 2004 Posted November 19, 2004 Help needed I' m having the same problem like you have and was wondering if you had found a solution to the problem already. If so could you please post it to me at following adress steven@quasus.be Kind regards Steven I am running a simple VB.NET program that kills a process, winword.exe. It works fine on all machines except a Windows 2000 Terminal Server. I get the error below: Can anyone suggest anything? The code I used is here: msdn.microsoft.com/library/default.asp?url=/library/en-us/ cpref/html/frlrfsystemdiagnosticsprocessclassgetprocessesbynametopic1.asp ************* Exception Text ************** System.ComponentModel.Win32Exception: Access is denied at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.get_HasExited() at WindowsApplication8.Form1.Button1_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.