Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # Filename: win_sign_in_cli.py
- # Version: 1.0.3
- # Author: Jeoi Reqi
- """
- Windows 11 Sign-in CLI Tool
- This script is a command-line interface (CLI) tool designed for managing sign-in options and password settings in Windows 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.
- 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.
- 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.
- Requirements:
- - This script is designed for Windows 11.
- - It requires Python 3.x to be installed on the system.
- Usage:
- - Run the script in a terminal or command prompt.
- - Follow the on-screen menu instructions to perform desired actions.
- Functions:
- 1. change_sign_in_method():
- - Opens the sign-in options control panel, allowing users to change their sign-in method using the Windows settings.
- 2. enable_disable_password():
- - Opens the Advanced User Account Control Panel (netplwiz), enabling or disabling the user password at Windows startup.
- Note: This function requires elevated permissions to edit the user account settings.
- Additional Notes:
- - Ensure that the script is run with appropriate permissions, especially when using the 'enable_disable_password()' function.
- - Users should exercise caution when making changes to sign-in options and password settings, as it may impact system security.
- - To apply the changes completely, you will need to log off and sign in again.
- """
- # Get Essential Imports
- import os
- import sys
- # Function to open sign-in options control panel
- def change_sign_in_method():
- print("Opening Sign-in options page...")
- os.system("start ms-settings:signinoptions")
- # Function to enable or disable the user password at windows startup
- def enable_disable_password():
- print(
- "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"
- )
- os.system("start netplwiz") # This requires elevated permissions to edit
- def header():
- print(
- """
- .---.
- / |\________________
- ( () | ________ _ _)
- \ |/ | | | |
- `---' '-' |_|
- """
- )
- def main():
- while True:
- header()
- print("\nWelcome to Windows 11 Sign-in Options Menu")
- print("------------------------------------------\n")
- print("1. Change Sign-in Method")
- print("2. Enable\Disable Password")
- print("0. Exit")
- choice = input("\nEnter the number of your choice: ")
- print("------------------------------------------\n")
- if choice == "1":
- change_sign_in_method()
- elif choice == "2":
- enable_disable_password()
- elif choice == "0":
- print("Exiting program... Goodbye!")
- sys.exit() # Exit the program
- else:
- print("Invalid choice! Please enter a valid option.\n")
- print("------------------------------------------\n")
- input("Press Enter to return to the menu...\n\n\n\n\n")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement