Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # Filename: clipboard_fix_csv_reset.py
- # Version: 1.0.0
- # Author: Jeoi Reqi
- """
- This script is designed to fix issues related to clipboard functionality on Windows systems by resetting and restarting essential services.
- Specifically, it targets the "Remote Desktop Services UserMode Port Redirector" and "ClipSVC" services, which are critical for clipboard operations.
- The script first stops these services using the 'net stop' command, ensuring that any existing processes associated with them are terminated gracefully.
- It then starts the services again using the 'net start' command, effectively resetting them to their default state.
- By executing this script, users can resolve common clipboard problems on Windows, such as malfunctioning clipboard operations or locked memory issues.
- This script provides a convenient and efficient way to address these issues without the need for manual intervention or complex troubleshooting steps.
- Requirements:
- - Python 3.x
- - Administrative privileges may be required for execution.
- Usage:
- - Run the script with Python 3.x from the command line.
- - Ensure administrative privileges are granted if prompted.
- Additional Notes:
- - Ensure 'net stop' and 'net start' commands are available.
- - Verify service status post-execution for confirmation.
- """
- import subprocess
- def stop_service(service_name):
- """Stop the specified Windows service."""
- subprocess.run(["net", "stop", service_name], shell=True)
- def start_service(service_name):
- """Start the specified Windows service."""
- subprocess.run(["net", "start", service_name], shell=True)
- def main():
- """Main function to stop and start essential services."""
- services = [
- "Remote Desktop Services UserMode Port Redirector",
- "ClipSVC"
- ]
- print("\n\t\t[CLIPBOARD FIX CSV RESET]\n\n")
- for service in services:
- print(f"\nStopping service:\n{service}")
- stop_service(service)
- print(f"\nStarting service:\n{service}")
- start_service(service)
- print("\n\t\tAll Processes Have Completed.\n\n\t\tEnding Program... GoodBye!\n")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement