Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # Filename: easeofaccess_shortcut.py
- # Version: 1.00
- # Author: Jeoi Reqi
- """
- EASE OF ACCESS SHORTCUT:
- This script creates a shortcut on the desktop that opens the Ease of Access Center in Windows.
- Requirements:
- - Windows operating system
- Usage:
- - Run the script to create a shortcut on the desktop that opens the Ease of Access Center.
- Notes:
- - The shortcut will be named "Ease_of_Access_Center.lnk".
- - The Ease of Access Center will open when the shortcut is double-clicked.
- """
- import os
- import subprocess
- def create_ease_of_access_center_shortcut():
- """
- Create a shortcut to the Ease of Access Center on the desktop.
- """
- # Get the path to the desktop
- desktop_path = os.path.join(os.environ['USERPROFILE'], 'OneDrive', 'Desktop')
- # Create a shortcut on the desktop using PowerShell
- powershell_command = fr'''
- $WshShell = New-Object -ComObject WScript.Shell
- $Shortcut = $WshShell.CreateShortcut("{desktop_path}\Ease_of_Access_Center.lnk")
- $Shortcut.TargetPath = "control.exe"
- $Shortcut.Arguments = "/name Microsoft.EaseOfAccessCenter"
- $Shortcut.Save()
- '''
- subprocess.run(['powershell', '-Command', powershell_command], capture_output=True)
- if __name__ == "__main__":
- create_ease_of_access_center_shortcut()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement