C
C#8mo ago
leave

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

in another process?
6 Replies
SpReeD
SpReeD8mo ago
What exactly do you wanna delete? You cannot delete a process of another process, since it's a process itself.
phaseshift
phaseshift8mo ago
This sounds nefarious
jcotton42
jcotton428mo ago
@leave what for?
Angius
Angius8mo ago
Just show a prompt "valorant-account-stealer.exe finished it's work, you can delete it now"
leave
leaveOP8mo 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
SpReeD8mo 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%';
Want results from more Discord servers?
Add your server