Answer the question
In order to leave comments, you need to log in
How to hide the shutdown buttons in windows 7+ through the command line (script)?
How to prevent users from shutting down or restarting a Windows 7 computer using a command line (script)?
I found an article on how to do this through gpedit.msc windowstips.ru/notes/847
But it's not clear how this can be done from a script.
Any version of bat, powershell, or code in any programming language (C# basic, etc.) will do.
The only important thing is that this must be done without restarting the computer. those. the variant with change of parameters of the register will not give a ride.
Answer the question
In order to leave comments, you need to log in
I managed to solve the problem myself, through the registry :)
The meaning is this, we edit the registry parameters, then we pull gpupdate with the / force
key. I will give the
code for solving my problem.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoClose"=-
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoClose"=-
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoClose"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoClose"=-
@echo off
echo Wait please. Program is loading...
start /wait regedit.exe /s %~dp0remove.reg
start /wait /min gpupdate /force
cls
echo Program started. You can work.
start /wait mstsc.exe
cls
echo Wait please. Program is closing...
start /wait regedit.exe /s %~dp0add.reg
start /wait /min gpupdate /force
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question