Skip to content

Powershell script that automatically detects and copies files from a USB when plugged in

Notifications You must be signed in to change notification settings

bishal0602/plug-n-copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plug-n-Copy

Plug-n-Copy allows you to secretly copy files from a USB drive to a destination folder when it's plugged in.


Project Structure

Plug-n-Copy
├── Scripts
├   ├── Register-PlugNCopy.ps1
├   ├── Unregister-PlugNCopy.ps1
├── Plug-n-Copy.psd1
├── Plug-n-Copy.psm1
├── README.md

Usage

  1. Install the Plug-n-Copy module from Powershell Gallery by running the following command:
Install-Module -Name "Plug-n-Copy"
  1. Register USB monitoring and file copying:
Register-PlugNCopy -Destination "C:\Destination"

The -Destination parameter specifies the destination folder where the files will be copied. The -ShowMessage switch can be used to display the file copied message on the terminal.

  1. Plug in a USB drive. The module will detect the connection and copy the files to the specified destination folder.

  2. When you're done, unregister USB monitoring and clean up variables:

Unregister-PlugNCopy

Enjoy using Plug-n-Copy!

Additional Details

For more details on the parameters and usage, run:

Get-Help Register-PlugNCopy -Detailed

About

Powershell script that automatically detects and copies files from a USB when plugged in

Topics

Resources

Stars

Watchers

Forks