Posts

Showing posts from May, 2024

Create Windows Shortcut Using Python

    import subprocess       def run_powershell_command ( command ):         try :             # Execute PowerShell command             result = subprocess. run (                 [" powershell ", " -Command ", command ], capture_output = True , text = True             )             # Check if the command executed successfully             if result.returncode == 0 :                 return True             else :                 return False         except Exception as e:             return False     def CreateShortcut ( shortcut_name = " Shortcut ", execution = None , ico...