C
C#4mo ago
leave

How can I remove/delete an executable (".exe") file once it ceases running or being utilized

in another process?
6 Replies
SpReeD
SpReeD4mo ago
What exactly do you wanna delete? You cannot delete a process of another process, since it's a process itself.
phaseshift
phaseshift4mo ago
This sounds nefarious
jcotton42
jcotton424mo ago
@leave what for?
Angius
Angius4mo ago
Just show a prompt "valorant-account-stealer.exe finished it's work, you can delete it now"
leave
leave4mo ago
I don't necessarily need to delete, but simply to know how we can implement that in C#. To know when a process is running (thus, when it stops running), or not running at all.
SpReeD
SpReeD4mo ago
Either through the build in Process class in System.Diagnostics -> https://learn.microsoft.com/de-de/dotnet/api/system.diagnostics.process?view=net-8.0 -> with the static Method GetProcessesByName(processName) or through WMI through PInvoke or better the ManagementObjectSearcher where you can write a SQL query -> SELECT * FROM Win32_Process WHERE Name LIKE 'valorent-account-stealer%';