Computer Hope

Software => Computer programming => Topic started by: mits81 on February 01, 2020, 08:43:44 AM

Title: Small script required
Post by: mits81 on February 01, 2020, 08:43:44 AM
Need to identify when a USB device has been plugged in, look for a file on the device, if file found then copy contents of device to a sub folder called current date, inside the folder named the same as the file looked for.

e.g.

Name of File: File1
if found, should copy device contents to a folder D:\File1\01022020

Any suggestions on where to start.
Title: Re: Small script required
Post by: DaveLembke on February 01, 2020, 11:59:17 AM
The script would be one that could be used for malicious intent. A computer with this running as a service seeing any USB device and copying all contents sounds like data theft.

What is the intent of this to where it can be used in a non-malicious way?

Looking for a file found can all so easily be replaced with a wildcard instruction to grab all data and steal data!  :-\

Any computer that is used by others with this would basically steal information from them upon inserting a USB stick.  ::)

A better approach would be that your working in IT and need to track users and place a script on the thumb drive that reports home with a file that needs to be saved with a date/time folder from a user instead of the other way around. This way only those USB sticks run the script when the users want it to, instead of trying to potentially hide that data is being copied from USB stick. The users should really have control of what data they are sharing and a script this way would do that and a DOS SHELL window would pop up for a moment and then disappear after the copy process complete.