How to hide Shut Down and Log Off through commandline(script) without reboot

How to hide Shut Down and Log Off buttons in Windows 7 through commandline(script) without reboot.

I've googled how it can be done through gpedit.msc http://www.thewindowsclub.com/prevent-users-shutting-down-restarting-windows-computer

Method with ntrights.exe wont work.

I'll glad to any solutions batch, powershell, c# etc.

Answers


GPUpdate /force

Although it will happen every hour automatically.


I am assuming you do not intend to use it for anything illegal, right?

Ok here's an approach.

Download Process Monitor tool: https://technet.microsoft.com/en-us/library/bb896645.aspx

Start ProcMon.exe and make the changes on the needed group policies.

Find the changed registry values in ProcMon so you know which registry values you need to edit with the script/c# code.

Here is a little example of how to edit registry values with c#:

RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\", true);

if (regKey != null)
{
// create a registry subkey
regKey = regKey.CreateSubKey("Appx");
// create a dword
regKey.SetValue("AllowAllTrustedApps", "1", RegistryValueKind.DWord);
regKey.Close();
}

Need Your Help

How can I run a python script on many files to get many output files?

python linux bash shell python-2.7

I am new at programming and I have written a script to extract text from a vcf file. I am using a Linux virtual machine and running Ubuntu. I have run this script through the command line by changi...

How Convert hex ip from Java?

ip converter

i used cat /proc/pid/net/udp6 and become: