C
C#9mo ago
leave

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

in another process?
6 Replies
SpReeD
SpReeD9mo ago
What exactly do you wanna delete? You cannot delete a process of another process, since it's a process itself.
phaseshift
phaseshift9mo ago
This sounds nefarious
jcotton42
jcotton429mo ago
@leave what for?
Angius
Angius9mo ago
Just show a prompt "valorant-account-stealer.exe finished it's work, you can delete it now"
leave
leaveOP9mo 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
SpReeD9mo 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