7 hours ago, nerdv2 said:
Are you sure that autoplay and autorun are enabled?
Enabling autorun/autoplay is bad idea security-wise.
You could force it to be enabled via group policy.
If you have time, prefer to detect the device dynamically with C# using InteropServices.
And you can execute the batch script or even customize it yourself.
It probably could be done if I knew any programming at all.
I found a solution though: I looked up the event ID and source when the external SSD gets plugged in, then I used that as a trigger in Event planner to start the copy "script" stored on the external SSD.
However then I was running into an issue where if I plug in another external drive, it starts the copy if the external SSD is still connected. I solved that by making a more detailed filter for the trigger event as shown:
<QueryList> <Query Id="0" Path="Microsoft-Windows-Ntfs/Operational"> <Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Ntfs'] and (Level=4 or Level=0) and (EventID=98) and TimeCreated[timediff(@SystemTime) <= 10000]]] and *[EventData[Data[@Name='DriveName'] and (Data='W:')]]</Select> </Query> </QueryList>
I found out how to do that here.
This way the event "Import laptop backup" only triggers when the external SSD is inserted, and it ignores any other (NTFS) external drives.