Sysinternals Handle.exe is not detecting process handles that Process explorer can view - handle

When i run Sysinternal Process Explorer i can see when cheatengine is attached to another process and i cant do the same thing with Handle.exe (Same company command line tool). I have tried each 32 bit and 64 bit versions of Handle.exe . It doesnt show processes , it shows all other handles but processes. Anybody has got an idea about this issue? I just need to view if a process handles another process like Process Explorer does.

Related

Using Event Viewer to find the cause of a crashing program - Windows 10

Currently I run a python script on a windows 10 computer by calling the script with a .bat file through windows scheduler. Pause is included in the .bat file, so typically when the program crashes I am provided to opportunity to read the traceback.
Recently the script has been closing outright with no explanation or visible traceback. This leads me to believe that the script is running fine, but Windows 10 is terminating it outright.
To try to identify the root cause of the issue I have attempted to gather information from windows 10 event viewer, but I cannot find any record of the program being closed. Documentation for the event viewer is awful, and I was hoping someone could point me in the right direction to find a record of the program crashing in the event viewer.
Thank you,
gintdm

Debugging Azure WebJob locally - recompile fails

I have a webjob that I'm debugging locally as a console app. But once I stop the code from within VS2017 I'm unable to recompile the exe as I get the following error
Unable to copy file "obj\Debug\******.******.exe" to "bin\Debug\******.******.exe". Access to the path 'bin\Debug\******.******.exe' is denied.
When I look at the processes that are running theres nothing there that jumps out.
I've closed VS and restarted it, but thats not cleared the issue.
Other than restarting my machine is there anything else I can try?
You can use the Windows Resource Monitor tool. Once opened, navigate to the CPU tab and enter the full path of the .exe (e.g. C:\Project\bin\debug\App.exe) in the Search Handles text box in the bottom-mid right corner and search. You should see the list of processes currently locking on the particular resource (in this case, the .exe). Select all the unwanted processes, right-click and end process. Depending upon on the version of Windows you are running, the experience might differ a bit but the general idea is more or less the same.

Unable to debug in Visual Studio because process can not access file

When I try to debug in Visual Studio I get the error message:
Unable to copy file "C:\Users\Name\Dropbox\Company Name\Development\Product Name 4 - Release Candidate\packages\MahApps.Metro.1.1.2.0\lib\net45\MahApps.Metro.dll" to "bin\Debug\MahApps.Metro.dll". The process cannot access the file 'bin\Debug\MahApps.Metro.dll' because it is being used by another process. Product Name 4 - Release Candidate
How can I fix this error?
This happens all the time in Dropbox. Dropbox does some occasional (very brief) locking of files as it is indexing them, and if you happen to attempt to open a file handle with the write attribute set at the same moment, the program will receive a file I/O exception (this can happen to your own code as well, so if you regularly work in Dropbox, be sure to handle that gracefully).
Try compiling/running it again and see if the problem goes away. If not, then you likely still have an instance of your application running in the background. This can occur if your program ever forks. VS will terminate the original process, but often not forked processes from it. Check task manager to be sure. It will be listed as a background process in Windows 8/8.1

How to find my JavaFX application in process manager?

I have a JavaFX application that should check if it has already been launched when you launch it (need only single instance running at the time). The problem is how to define it!
I have tried packing my JavaFX application into .exe file (or make an .exe launcher) that will be shown as the "MyProg.exe" process in the Windows task manager, not the "javaw.exe". But it is not the solution (I've tried netbeans' tools) because it adds jre to my application thus enlarging it from 1 mb. to 130+ mb. (can you help me with it?)
I've tried launch4j, but both launcher and .exe package starts javaw.exe to run my app. And when I check process manager and see 2 javaw.exe I don't know, is it 2 instances of my app or just another app running?
I hope I described it clearand will be very thankful if somebody can help me with it!
Judging by your approach it seems that you are already found a way to get a list of Windows' processes from Java. In this case you can use one of the next solutions:
Take other process info into account. E.g. command line or window title. Windows command line can be retrieved using wmic.exe PROCESS command and for Unix-bases systems by ps -Af.
When your program starts store it's process id in the registry or file in homedir. When another instance starts it should check that value and if process with that id alive then just exit.

I can't kill MyApp.vshost.exe

I've managed to get myself in a state where I've no instances of devenv running, but still a MyApp.vshost.exe in the background (no visible windows or consoles).
I've tried TaskManager, ProcessExplorer and command line (taskkill /F /IM MyApp.vshost.exe), none of them complain, the command line even says 'PID 5824 stopped', but it's still there.
I know I can reboot, but I'd rather get to the bottom of this.
It doesn't look like it's this issue (http://support.microsoft.com/kb/982551), because I can reboot no problem (just have in fact, so won't be able to provide any further diagnostics, sorry).
EDIT
This is how I got into this pickle:
I was able to kill my persistent vshost process by following these steps (VS2010):
open the properties of my executable project
in the "Debug" tab, uncheck "Enable the Visual Studio hosting process"
save the project file
That was it, the process stopped, and there was no need to restart Visual Studio.
It seems to be the normal behaviour for this task. When you kill it the task is restarted.
So i advice you to close Visual Studio, that closes the *.vshost.exe task.
I had the same problem while working on a project with .NET 2.0 as target framework.
Temporary changing the target framework to .NET 4.0 client did the job for me.
However, Iam unsure how this is (is it?) related to the file lock issue.
Maybe that's the same problem as described in https://stackoverflow.com/a/1582747/254041 (pending I/O processes):
The MSDN API ref says "TerminateProcess initiates termination and returns immediately. This stops execution of all threads within the process and requests cancellation of all pending I/O. The terminated process cannot exit until all pending I/O has been completed or canceled.". Which means so much as: your I/O can block this process (though I wonder how it can bring your process to 100%, I/O usually doesn't do that).

Resources