Automation
Hereβs an updated Automation & Scheduled Tasks section with both CMD and PowerShell commands laid out in a copy-friendly format.
π Windows Automation & Scheduled Tasks (CMD + PowerShell)
Below are useful automation tasks using both Command Prompt (CMD) and PowerShell, allowing you to schedule tasks, automate maintenance, and manage system operations efficiently.
1οΈβ£ Schedule a Task to Run Every Night
β CMD:
β PowerShell:
π Purpose: Runs a cleanup script every night at 11 PM.
π Use Case: Automating log cleanups, backups, or maintenance.
2οΈβ£ Automatically Shutdown the PC at a Specific Time
β CMD:
β PowerShell:
π Purpose: Shuts down the PC after 1 hour (3600 seconds).
π Use Case: Prevents computers from staying on overnight.
3οΈβ£ Restart the PC After a Set Time
β CMD:
β PowerShell:
π Purpose: Restarts the PC after 30 minutes (1800 seconds).
π Use Case: Used after installing software updates.
4οΈβ£ Schedule a System Reboot Every Sunday at 2 AM
β CMD:
β PowerShell:
π Purpose: Forces a system reboot every Sunday at 2 AM.
π Use Case: Ensures servers or workstations stay refreshed.
5οΈβ£ Empty the Recycle Bin Automatically
β PowerShell:
π Purpose: Deletes all items in the Recycle Bin.
π Use Case: Helps free up disk space automatically.
6οΈβ£ Uninstall a Program Silently
β CMD:
β PowerShell:
π Purpose: Removes a program silently without user prompts.
π Use Case: Useful for mass uninstallations.
7οΈβ£ Create a Backup of a Folder Daily
β CMD:
β PowerShell:
π Purpose: Backs up an entire folder to another drive.
π Use Case: Automates file backups.
8οΈβ£ Disable Windows Defender Temporarily
β PowerShell:
π Purpose: Temporarily disables Windows Defender real-time protection.
π Use Case: Useful when installing trusted third-party software.
9οΈβ£ Enable Windows Defender Again
β PowerShell:
π Purpose: Re-enables Windows Defender after temporary disabling.
π One-Click Full System Cleanup
β PowerShell:
π Purpose: Runs a disk cleanup, empties the Recycle Bin, and deletes temp files.
π Use Case: Automates cleanup tasks for better performance.
π How to Use These Scripts
1. For CMD: Open Command Prompt (cmd.exe) as Administrator and paste the command.
2. For PowerShell: Open PowerShell as Administrator and paste the script.
3. For Automation: Add PowerShell scripts to Task Scheduler to run them automatically.
π₯ These automation scripts save time, optimize performance, and improve system efficiency! Let me know if you need more! π
Last updated
Was this helpful?