Home » PC Utilities » How to Prevent Users and Yourself From Closing a Program in Windows [2025 Guide]
If you’re looking to prevent programs like Microsoft Outlook from closing, I got good news for you. There are a few native Windows tricks you can apply.
I also tested some apps that claim to disable the close button.
Below, I’ll give you an overview of these apps and also show you a few tricks to stop apps from closing with Windows tools like the Kiosk Mode or Group Policy Editor.
Tools to stop users from closing apps in Windows
1. NoClose
If you’ve heard of DonationCoder, Skrommel came out with a simple and easy to use portable tool called NoClose where it simply disables the Close (X) button located at the top right of the window. To disable the close button on a selected window, press Ctrl+1 to temporarily enable or disable it. If you want the changes to be permanent, press Ctrl+2 instead to add the program to the rules. Make sure that NoClose is running or else it won’t work. From what I’ve noticed, NoClose only disables the Close button located at the top right of the window while other methods such as Alt+F4 still works. It is possible to change the default hotkeys from the Settings by right clicking on the NoClose icon at the notification area and select Settings. NoClose is free and has been successfully tested on Windows 7 SP1 32-bit without problems.
2. WinTopMost
WinTopMost is the most expensive software in its category that cost $65 for a single license. Other than disabling the Close button by graying it out, it can also set a window to be topmost based on the program’s title. For WinTopMost to disable a program’s close button, click the Add button at the 2nd box and enter the program’s name that is displayed on the title, for example, Firefox. WinTopMost also needs to be active to disable the close button and it doesn’t prevent against Alt+F4 hotkey.
3. Actual Window Guard
Actual Window Guard is a shareware that cost $29.95 for a single license and it comes with a 60 days trial. It is quite powerful in the sense that it allows you to create very detailed specific settings other than just disabling the close button. It also allows you to assign priorities, window size and position, and automatic actions such as changing caption, icon, staying always on top, open as, send to bottom, close and etc when the program is started. Actual Window Guard offers an additional method to prevent any window from accidental close by showing a confirmation prompt when you want to close the program.
4. Actual Window Manager
Actual Window Manager is the bigger brother of Actual Window Guard. It is also a shareware that cost slightly more expensive when compared to Actual Window Guard at $49.95 due to having more features. Other than disabling the close button and showing a confirmation window, it comes with an additional option where you can manually close the window by right clicking on the close button. This options is very useful to manually close the program because both Actual Window Manager and Actual Window Guard blocks the Alt+F4 hotkeys as well.
5. NoVirusThanks Process Protector
NoVirusThanks is an Italian company that puts their focus more to security. Process Protector is a shareware that cost $19.99 and there are no trial version for you to test it out. The program claims to defend against process termination so I requested a license to test it. Upon testing, it seems to only protect against abnormal or external method of termination such as killing the process from Windows Task Manager, while still allowing the user to close the program by clicking the X button or using Alt+F4.
For simple use, I would say that NoClose seems to do the job pretty well plus it is lightweight and free. If you prefer to go for something more powerful with more features and willing to fork out some money, do give Actual Window Manager a try because you will not be disappointed.
Now, let’s move on to methods that require no software buying/installation. Note that they may not give you as many options and you’ll have to go through a few workarounds.
Prevent Programs from Closing: Manual Solutions
1. Try Kiosk Mode
- Open Settings > Accounts > Family & other users.
- Under Set up a kiosk, click Assigned access.
- Choose the account and select the app you want to lock to.
- Once configured, the system will only allow that specific app to run, preventing users from closing it.
Kiosk Mode is a built-in feature in Windows 10 and 11 that locks down a device to only run a specific application.
By using this mode, users are unable to close or switch away from the chosen app. This is perfect for scenarios where you need a program running continuously, such as in a business environment or public kiosk.
2. Use the Group Policy Editor
- Press Windows + R, type gpedit.msc, and press Enter to open the Group Policy Editor.
- Navigate to User Configuration > Administrative Templates > Start Menu and Taskbar.
- Locate and enable the policy Do not allow pinning programs to the taskbar or other related options to restrict certain behaviors.
- Alternatively, you can also use Group Policy to configure taskbar settings, preventing the close button from appearing for specific applications.
Group Policy is another powerful tool for preventing users from closing applications. This method works especially well in a corporate environment where you need to enforce rules across multiple machines.
3. Batch Files or Scripts
Another manual solution is to create a batch file or PowerShell script that automatically restarts a program if it is closed. This is useful if you want to make sure your program keeps running without needing to constantly monitor it.
- Open Notepad and enter the following script: batchCopyEdit
:start tasklist /FI "IMAGENAME eq [ProgramName].exe" 2>NUL | find /I "[ProgramName].exe">NUL if %errorlevel% NEQ 0 start [FullPathToProgram] timeout /t 10 goto start
Replace[ProgramName]
and[FullPathToProgram]
with the actual program name and path. - Save the file as RestartProgram.bat.
- Run the batch file whenever you need to ensure the program stays open.
Final Thoughts
In conclusion, there are several effective ways to prevent programs from closing on Windows, depending on your needs and preferences. If you’re looking for a straightforward solution, NoClose is a free and lightweight tool that works well for basic use. For those who want more advanced features, Actual Window Manager offers a range of options, including blocking the close button and preventing accidental closures.
While the solution for Chrome was straightforward with the Google Toolbox extension, these tools offer varying levels of success for other software. Choose the one that best fits your needs to avoid accidental closures.
However, if you prefer not to rely on third-party software, Windows also offers native tools such as Kiosk Mode, Group Policy Editor, and Batch Files that can be set up to prevent program closures or automatically restart applications. While these solutions might not provide as much control as some paid software, they are effective and cost-free options for managing app behavior.
Я уже задавал этот вопрос недавно, мне посоветовали запустить программу из-под другого пользователя. Якобы у него не будет прав закрывать программы запущенные из под администратора. Я создал задачу в Планировщике заданий.
Код задачи
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2015-01-27T18:30:34</Date>
<Author>Pete</Author>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<StartBoundary>2015-01-27T18:30:00</StartBoundary>
<Enabled>true</Enabled>
</LogonTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>WIN-H9OUVR61LNP\testUser</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>"c:\Users\user\Documents\Visual Studio 2012\Projects\WorkersController\WorkersController\bin\Debug\WorkersController.exe"</Command>
</Exec>
</Actions>
</Task>
Разве что задача запускается из-под текущего пользователя testUser(обычный пользователь), по другому программа просто не запускалась.
Ну и эту программу пользователь спокойно убивает в диспетчере задач. Даже если зайти за учетку пользователя и запустить её от имени администратора (shift+rClick->Запустить от имени другого пользователя) мою программу, то пользователь всё равно может убить процесс.
Я не хочу отбирать у пользователя возможность вызывать диспетчер задач, блокировать нажатия alt+f4 перехватывать системые вызовы итд… итп… Можно ли «по простому» запретить пользователю закрывать программы ?
#RequireAdmin
#include <WindowsConstants.au3>
#include <HotKey.au3>;http://autoit-script.ru/index.php/topic,296.0.html
#include <vkConstants.au3>
#include <GuiMenu.au3>
If Not IsAdmin() Then
MsgBox(16, 'Error', 'Вы не админ, до свидания')
Exit
EndIf
Opt('WinWaitDelay', 0)
_HotKeyAssign(BitOR($CK_ALT, $CK_SHIFT, $CK_CONTROL, $VK_INSERT), '_Quit') ;Alt+Shift+Ctrl+Insert
_HotKeyAssign(BitOR($CK_ALT, $VK_F4), '_Fig_Vam', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL))
_HotKeyAssign(BitOR($CK_WIN, $VK_D), '_Fig_Vam', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL))
_HotKeyAssign(BitOR($CK_WIN, $VK_M), '_Fig_Vam', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL))
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableTaskMgr', 'REG_DWORD', '1')
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableRegistryTools', 'REG_DWORD', '1')
Run(@WindowsDir & '\notepad.exe')
$hWindow = WinWait('[REGEXPCLASS:Notepad.*]', '', 3)
If Not $hWindow Then Exit
WinSetState($hWindow, '', @SW_MAXIMIZE)
_WinSetStyle($hWindow, -1, $WS_EX_TOOLWINDOW)
$hMenu = _GUICtrlMenu_GetSystemMenu($hWindow)
_GUICtrlMenu_EnableMenuItem($hMenu, $SC_CLOSE, 1, False)
While 1
Sleep(10)
WEnd
Func _Quit()
_WinSetStyle($hWindow, BitOR($WS_SIZEBOX, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU))
_GUICtrlMenu_EnableMenuItem($hMenu, $SC_CLOSE, 0, False)
WinSetState($hWindow, '', @SW_RESTORE)
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableTaskMgr', 'REG_DWORD', '0')
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableRegistryTools', 'REG_DWORD', '0')
Exit
EndFunc ;==>_Quit
Func _Fig_Vam($iKey)
MsgBox(16, 'Error', 'Нельзя')
EndFunc ;==>_Fig_Vam
Func _WinSetStyle($hWnd, $nStyle = -1, $nExStyle = 0)
Local Const $GWL_STYLE = -16, $GWL_EXSTYLE = -20
Local Const $SWP_NOMOVE = 0x2, $SWP_NOSIZE = 0x1, $SWP_SHOWWINDOW = 0x40, $SWP_NOZORDER = 0x4
Local $iFlags = BitOR($SWP_SHOWWINDOW, $SWP_NOSIZE, $SWP_NOMOVE, $SWP_NOZORDER)
If $nStyle = -1 Then $nStyle = BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)
DllCall('User32.dll', 'int', 'SetWindowLong', 'hwnd', $hWnd, 'int', $GWL_STYLE, 'int', $nStyle)
DllCall('User32.dll', 'int', 'SetWindowLong', 'hwnd', $hWnd, 'int', $GWL_EXSTYLE, 'int', $nExStyle)
DllCall('User32.dll', 'int', 'SetWindowPos', 'hwnd', $hWnd, 'hwnd', 0, 'int', 0, 'int', 0, 'int', 0, 'int', 0, 'int', $iFlags)
EndFunc ;==>_WinSetStyle
Windows 10 — это мощная операционная система, которая включает в себя множество различных функций и настроек, которые могут быть использованы для управления приложениями и программами. В этой статье мы рассмотрим несколько полезных советов, которые помогут вам контролировать работу приложений, блокировать запуск не желательных программ и ограничить доступ к ним.
Как запретить Windows закрывать программы
Чтобы предотвратить закрытие программ в Windows 10, вам необходимо включить Политики ограниченного использования программ. Для этого выполните следующие действия:
- Откройте Редактор локальной групповой политики.
- Перейдите в Конфигурацию компьютера — Конфигурацию Windows — Параметры безопасности.
- Выберите Политики ограниченного использования программ.
- Нажмите на Действие > Создать политику ограниченного использования программ.
Как поставить запрет на удаление приложений Windows 10
Чтобы запретить удаление приложений в Windows 10, выполните следующие действия:
- Откройте Пуск и выберите Параметры.
- Нажмите на Обновление и безопасность.
- В разделе Безопасность Windows выберите Защита от вирусов и угроз.
- Нажмите на Параметры защиты от вирусов и угроз.
- В разделе Исключения выберите Добавление или удаление исключений.
Как запретить доступ к программе Windows 10
Если вы хотите запретить доступ к определенным программам в Windows 10:
- Откройте веб-браузер и перейдите на страницу family.microsoft.com.
- Войдите в учетную запись «Семейной безопасности».
- Найдите члена семьи и выберите Дополнительные параметры > Время работы экрана > Приложения и игры.
- Выберите приложение или игру, на использование которых вы хотите наложить ограничения.
Как заблокировать запуск программы в Windows 10
Чтобы заблокировать запуск программы в Windows 10, выполните следующие действия:
- Щелкните правой кнопкой мыши на нужном приложении.
- Во всплывающем меню выберите «Заблокировать «.
- Выбранное приложение будет заблокировано в кэше.
Как настроить AppLocker
AppLocker — это утилита безопасности, которая позволяет управлять доступом пользователей к определенным приложениям и службам Windows. Чтобы настроить AppLocker, выполните следующие действия:
- Перейдите в раздел Параметры безопасностиПолитики > управления приложениями > AppLocker.
- Выберите Настроить принудительное применение правил.
- Установите флажок Настроено в разделе Исполняемые правила.
- Нажмите на ОК.
Выводы
Управление программами в Windows 10 — это важная задача для всех пользователей этой операционной системы. С помощью этих советов вы сможете дополнительно защитить вашу систему и свои данные от недобросовестных пользователей. Не забывайте, что правильная настройка безопасности — это ключевой компонент успешной работы в интернете.
- Можно ли оплатить картой в интернете без СМС кода
- Как запретить списание с карты без смс