This script performs a backup of the C: drive, excluding the Windows directory, to a target directory named after the computer in which the script is executed. The target directory is created in the same location as the script.
- Run as Administrator: Ensure the script is executed with administrative privileges to have the necessary permissions for file operations.
- Start the Script: Simply run the script. It will create a backup folder in the same directory where the script is located.
- Windows OS: This script is designed to run on Windows operating systems.
- Administrator Privileges: The script requests administrative privileges if not already run as an administrator.
The script performs the following steps:
- Check for Administrative Privileges: If not run as an administrator, it requests the necessary permissions.
- Define Source and Target Directories:
- Source: The entire C: drive, excluding the Windows directory.
- Target: A folder named after the computer in the same directory as the script.
- Create Target Directory: If the target directory does not exist, it is created.
- Copy Files: All files and directories from the source, excluding the Windows directory, are copied to the target directory.
- Pause: The script pauses upon completion to display the result of the copy operation.