I am writing code in Python 2 or 3 to script Cybersecurity functions. Functions such as Lockout Duration, Password Length, and other things that involve a lot of clicking that could easily be automated.

import subprocess
subproccess.call(x, shell = True)

I plan on using that format to run (or enter ((so I don't have to type only press the answer button))) commands in command prompt (with Administrator privileges). However, I have no idea how I should do this, especially the "Require Ctrl - Alt - Delete on Startup." Help would be greatly appreciated.

As of now, I thought of a possible solution to the password requirement part of my problem that I will investigate, but am still totally lost on the ctrl - alt - delete part. :D


You can set the registry key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DisableCAD to have value 0. The following command should (untested) do the trick:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DisableCAD /d 0 /t REG_DWORD /f
  • Thank you! I will check this out!! I will also tell you if it works :D. (because I can't just say thank you.) :) . Thanks a ton :D. – Enigmoramous Jan 8 '18 at 22:47

As an overall way to do it, if you can find out which settings are contained in the registry, it's not difficult to create/write registry keys to which you have access. Other settings, such as GPOs, are harder to do. Sometimes you can change those with Powershell - so you may need to have Python call Powershell to configure some of those settings. If you aren't on a domain and are using local policies, you can configure a master policy file that you have Python replace.

On the whole, if you're looking to configure settings for new devices, a better way to do that would be to create them on a VM and use DISM to snapshot a sysprepped image and then lay it down on a new device. That's the more "Windows-y" way to do it.

  • How would I make that master policy python file? (as that would be amazing for my purposes!) – Enigmoramous Jan 8 '18 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.