Skip to content

AdamZieman/RemoteFileCopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Remote File Copy

Overview

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.

Prerequisites

  1. Administrator Permissions: The script must be run with administrative privileges to access and modify system files.
  2. Device Connectivity: Both source and destination devices must be powered on and connected to the enterprise network.
  3. User Profile Presence: The user profile corresponding to the specified employee ID must exist on both the source and destination devices.

Script Functionality

  1. 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).
  2. Device and Profile Verification:

    • Confirms the devices are accessible on the network.
    • Verifies the existence of the user profile on both devices.
  3. 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.
  4. Browser Bookmark Migration:

    • Copies browser bookmarks for Microsoft Edge and Google Chrome, if they exist.
  5. Post-Copy Checks:

    • Prompts the administrator to consider additional setup steps, such as:
      • Configuring OneDrive.
      • Setting up Microsoft OneNote.
      • Mapping networked printers.

Usage

  1. Ensure all prerequisites are met.

  2. Run the script as an administrator.

  3. Follow the on-screen prompts to:

    • Enter the source device name.
    • Enter the destination device name.
    • Enter the employee ID.
  4. The script will validate your inputs and proceed to copy the required files and directories.

Output

  • 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.

Error Handling

  • 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.

Dependencies

  • Windows OS: Designed for Windows systems with standard directory structures.
  • The robocopy command and the xcopy command must be available on the system.

Troubleshooting

  • 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.

Notes

  • This script is intended for enterprise use and assumes an Active Directory environment with consistent device and user profile naming conventions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published