Advertisement
Python253

win_sign_in_cli

May 22nd, 2024
687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.57 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Filename: win_sign_in_cli.py
  4. # Version: 1.0.3
  5. # Author: Jeoi Reqi
  6.  
  7. """
  8. Windows 11 Sign-in CLI Tool
  9.  
  10. This script is a command-line interface (CLI) tool designed for managing sign-in options and password settings in Windows 11.
  11. It provides users with a menu-driven interface to perform actions such as changing sign-in methods and enabling or disabling the user password at Windows startup.
  12. By interacting with the script, users can easily navigate through various sign-in options and password settings without the need to access system settings directly.
  13. Additionally, the script ensures a seamless user experience by automatically returning to the main menu after each action, allowing users to perform multiple tasks efficiently.
  14.  
  15. Requirements:
  16.    - This script is designed for Windows 11.
  17.    - It requires Python 3.x to be installed on the system.
  18.  
  19. Usage:
  20.    - Run the script in a terminal or command prompt.
  21.    - Follow the on-screen menu instructions to perform desired actions.
  22.  
  23. Functions:
  24.    1. change_sign_in_method():
  25.       - Opens the sign-in options control panel, allowing users to change their sign-in method using the Windows settings.
  26.  
  27.    2. enable_disable_password():
  28.       - Opens the Advanced User Account Control Panel (netplwiz), enabling or disabling the user password at Windows startup.
  29.         Note: This function requires elevated permissions to edit the user account settings.
  30.  
  31. Additional Notes:
  32.    - Ensure that the script is run with appropriate permissions, especially when using the 'enable_disable_password()' function.
  33.    - Users should exercise caution when making changes to sign-in options and password settings, as it may impact system security.
  34.    - To apply the changes completely, you will need to log off and sign in again.
  35. """
  36.  
  37. # Get Essential Imports
  38. import os
  39. import sys
  40.  
  41. # Function to open sign-in options control panel
  42. def change_sign_in_method():
  43.     print("Opening Sign-in options page...")
  44.     os.system("start ms-settings:signinoptions")
  45.  
  46. # Function to enable or disable the user password at windows startup
  47. def enable_disable_password():
  48.     print(
  49.         "Opening netplwiz...\n\n::Open the Advanced User Account Control Panel::\n\t::(Flashing Shield In The Taskbar)::\n\nMake your selection:\n::🗹 Check To Enable::\n::☐ Uncheck To Disable::\n"
  50.     )
  51.     os.system("start netplwiz")  # This requires elevated permissions to edit
  52.  
  53. def header():
  54.     print(
  55.         """
  56.          .---.
  57.         /    |\________________
  58.        ( ()  | ________   _   _)
  59.         \   |/        | | | |
  60.          `---'         '-' |_|
  61.            """
  62.     )
  63.  
  64. def main():
  65.     while True:
  66.         header()
  67.         print("\nWelcome to Windows 11 Sign-in Options Menu")
  68.         print("------------------------------------------\n")
  69.         print("1. Change Sign-in Method")
  70.         print("2. Enable\Disable Password")
  71.         print("0. Exit")
  72.  
  73.         choice = input("\nEnter the number of your choice: ")
  74.         print("------------------------------------------\n")
  75.  
  76.         if choice == "1":
  77.             change_sign_in_method()
  78.         elif choice == "2":
  79.             enable_disable_password()
  80.         elif choice == "0":
  81.             print("Exiting program...   Goodbye!")
  82.             sys.exit()  # Exit the program
  83.         else:
  84.             print("Invalid choice! Please enter a valid option.\n")
  85.             print("------------------------------------------\n")
  86.         input("Press Enter to return to the menu...\n\n\n\n\n")
  87.  
  88. if __name__ == "__main__":
  89.     main()
  90.  
  91.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement