I'm exploring whether it's possible to implement a system-wide control mechanism in Windows that detects newly launched .exe processes in real time. My goal is to automatically apply temporary restrictions to any newly started .exe, such as suspending the process or blocking its internet access for about 60 seconds after it launches. This would need to work for any executable initiated through double-clicking, the Start Menu, or CMD, without requiring manual modification for each program.
I'm currently looking into PowerShell and other built-in Windows tools to achieve this, but I'm unsure about the reliability of real-time detection for new processes and whether these processes can be safely suspended. Additionally, I'm curious if Windows Firewall can dynamically enforce temporary network restrictions per process. I'm hoping to find out if this goal is realistic with user-mode scripting or if it requires more advanced system-level components. Any insights or guidance on this would be greatly appreciated!
5 Answers
Using something like ThreatLocker or Carbon Black might be a good solution here. They essentially do what you're envisioning but are built on more reliable foundations. This way you avoid the need to reinvent the wheel, plus you get added security features.
You could definitely look into using Windows Management Instrumentation (WMI) to get real-time notifications for new process creation. Libraries exist that specialize in process monitoring which could help you achieve what you're seeking, but you'd have to handle some of the pitfalls that come with it.
My advice? Don't go down this path. The potential for messing up system stability is high, and it could inadvertently turn into malware from the user's perspective. A better strategy would be to identify and allow only trusted applications beforehand, rather than trying to restrict them post-launch.
For sure! Trying to play catch-up after an .exe launches is risky. It's smarter to prevent issues before they happen.
Honestly, this seems like an XY problem. What are you really trying to achieve with these restrictions? If it's about preventing malware or unwanted actions, you might want to consider existing solutions rather than building a new one. Many antivirus programs already sandbox or inspect processes effectively, and they do so without requiring complex custom setups that could risk system stability.
Couldn’t agree more. If the goal is simply to stop dodgy execs, using antivirus tools or dedicated endpoint security solutions will do a better job without adding friction to your workflow.
Right? Plus, a custom approach like this could result in performance issues, especially if you're blocking critical. It's better to use tools designed to handle such cases.
It sounds like what you're looking to achieve is quite complex. While conceptually it could be possible to detect new processes in real time, doing so safely without affecting critical system processes might be challenging. Instead of trying to block network access or suspend processes, consider using established tools like AppLocker for controlling executable permissions right from the start. It's a more straightforward and safe approach, especially when dealing with user-launched applications. If you're on Windows 11 Pro, you might still have limited support for some AppLocker features, so definitely check that out!
Exactly! Preventing issues at the source is smart. AppLocker is designed for scenarios like this, allowing you to manage which applications can run on your system.
It's worth mentioning that some editions like Enterprise have better support for AppLocker configurations, making it a better choice if you require application whitelisting.

That's true. The focus should be on keeping your system stable and secure, and whitelisting known safe applications is a much more efficient strategy.