Skip to main content

Posts

Showing posts from August, 2025

Backup one folder to another location

 You can create a simple batch file (.bat) to back up a folder automatically in Windows. Here’s a step-by-step example: 🔹 Example: Backup one folder to another location @echo off set source="C:\MyData" set destination="D:\Backup\MyData_%date:~-4%-%date:~7,2%-%date:~4,2%" echo Backing up from %source% to %destination% xcopy %source% %destination% /E /H /C /I /Y echo Backup completed! pause 🔹 Explanation: set source= → Source folder you want to back up. set destination= → Destination folder where backup will be stored. %date:~-4%-%date:~7,2%-%date:~4,2% adds today’s date in YYYY-MM-DD format to the folder name (so each backup is stored separately). xcopy options: /E → Copy all subdirectories (including empty ones). /H → Copy hidden + system files. /C → Continue even if errors occur. /I → Assume destination is a folder. /Y → Suppress overwrite prompts. 🔹 Usage: Open Notepad . Paste the code above. Save it...