This batch script facilitates copying user profile files and directories between two devices within an enterprise network. It includes validation for device names and employee IDs, ensures the user profiles exist on both devices, and transfers files while excluding certain files and directories on predefined logic.
- Administrator Permissions: The script must be run with administrative privileges to access and modify system files.
- Device Connectivity: Both source and destination devices must be powered on and connected to the enterprise network.
- User Profile Presence: The user profile corresponding to the specified employee ID must exist on both the source and destination devices.
-
Input Validation:
- Validates the source and destination device names (7 or 9 characters long).
- Automatically prefixes device names with
DE
if only 7 characters are provided. - Checks the employee ID for valid formats (6, 7, or 9 characters).
-
Device and Profile Verification:
- Confirms the devices are accessible on the network.
- Verifies the existence of the user profile on both devices.
-
File Copying:
- Copies specific directories, such as
Desktop
,Documents
,Downloads
, and more, while preserving attributes and directory structure. - Excludes files listed in
remoteFileCopy_excludeFiles.txt
.
- Copies specific directories, such as
-
Browser Bookmark Migration:
- Copies browser bookmarks for Microsoft Edge and Google Chrome, if they exist.
-
Post-Copy Checks:
- Prompts the administrator to consider additional setup steps, such as:
- Configuring OneDrive.
- Setting up Microsoft OneNote.
- Mapping networked printers.
- Prompts the administrator to consider additional setup steps, such as:
-
Ensure all prerequisites are met.
-
Run the script as an administrator.
-
Follow the on-screen prompts to:
- Enter the source device name.
- Enter the destination device name.
- Enter the employee ID.
-
The script will validate your inputs and proceed to copy the required files and directories.
- Upon successful execution, the script displays a completion message and reminders for additional configurations.
- If an error occurs, the script provides detailed feedback and exits.
- Invalid Input: The script validates device names and employee IDs. If any input is incorrect, an error message is displayed, and the user is prompted to re-enter the information.
- Device or Profile Not Found: If a device is unreachable or the user profile does not exist, the script halts with an error message.
- File Copy Errors: The script skips any inaccessible files and logs warnings when specific directories or bookmarks are missing.
- General Errors: Unexpected issues cause the script to exit with a generic error message and no changes are made.
- Windows OS: Designed for Windows systems with standard directory structures.
- The
robocopy
command and thexcopy
command must be available on the system.
- Device Not Found: Ensure both devices are powered on, connected to the network, and their names are entered correctly.
- Profile Not Found: Verify the employee ID matches the user profile directory on both devices.
- This script is intended for enterprise use and assumes an Active Directory environment with consistent device and user profile naming conventions.