Good day.

There is such a situation: there is some service that starts when the computer boots and, if necessary, performs some actions. It is necessary that while these actions are performed no user can log in, because running applications can interfere with the service.

Question: is there any possibility to postpone the appearance of user choices, for example, how does Windows Update do (wait for the system setup ')? ..

Added: Windows 7, normal login, not terminal, not in domain. Because the service is written by me, then I am looking for a solution through WinAPI of the type: blocked - changed what was needed - unlocked.

    3 answers 3

    how does windows update

    Could be so. There is a limited set of actions, if you have enough, then you can use it. Read about Primitive Operations Queue Executor

    There is another option to hook into the boot process via BootExecute but there is only a Native API. Well and with examples about this technique you can read here . In all other cases, you have to "push your elbows" with other processes.

    • Looked, thanks. Not what I need, but apparently there are no other ways to do it (gina.dll is not counted). - Alekcvp
    • In fact, you can still try to replace HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell with a stub that displays a message to the user that the download is delayed. But I am not sure how to change this registry branch quickly. - Slipeer

    Here they offer to change the setting in the registry

     HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\TSServerDrainMode 0 = Allow all connections 1 = Allow reconnections, but prevent new logon until reboot 2 = Allow reconnections, but prevent new logon 

    PS I suspect that if the service hangs and does not return the state of the registry back, then you will have to edit it not through RDP, since the server will most likely reject connections, but go to the server and edit.

    You can also make a batch file, which will kick users, hang up in the schedule at intervals of 10 seconds.

    Also, as an alternative, you can open a notebook with a message when a user logs in with a message that maintenance is in progress.

    • No, no, windows - client, seven, the input is not through the terminal, but ordinary. - Alekcvp

    There is also such a "crutch" with a local policy that prohibits entry to the group and the content of this group: https://241931348f64b1d1.wordpress.com/2010/12/17/how-to-temporary-disable-interactive-logon-on-windows/