This solution is portable (unlike USBDLM)
You should use it's own directory for it (don't put it directly in <xyscripts>)
Unless I implement self elevation, use a non restricted (e.g. by UAC) path!
If you want to use it with an elevated XY instance, you have to start it with admin permissions (yourself)
It tries to execute the script(s) for all open XY instances!
ATM, this is in beta, it could burn your PC, destroy your relationship, be warned!
This is the first beta so expect bugs!
What it does?
When you insert / remove a removable media (e.g. an USB Stick) it will execute a script...
Two scripts are included, "Connect.xys" and "Disconnect.xys".
Connect.xys will add the drive letter to the tree (even for locked trees) and open a new tab with the drive as the target path
Disconnect.xys will remove all tabs (in active & inactive pane) that refer to the mounted drive letter and remove the entry from the tree
On first startup an .ini file will be created. Default entries for Connect / Disconnect will be set.
This .ini file understands "rules"
Each rule must begin with a number (beginning from 1, 2, ..., n), followed by "=" and then you can use either
- The drive letter / the serial number for that media
followed by an "|", followed by an absolute / portable path to a script
For example:
You can look up the serial number of a removable drive by going to the "Computer" node in XY.[Connect]
Default=.\Connect.xys
1=X|.\Connect_Drive_X.xys
2=Y|.\Connect_Drive_Y.xys
3=8EE7-0231|.\Connect_Drive_With_Serialnumber.xys
The column "Vol Serial" contains the belonging serial
The order for the entries in section "[Connect]" or "[Disconnect]" doesn't matter, the "Default" entry is always checked last,
the numbered entries are checked in ascending order.
The first match wins!
Any script you use must begin with:
Code: Select all
perm $P_AutoMounter_Drive;
I didn't expose a drive's serial number as a permanent variable (don't know if this is really necessary atm)
Todos:
- Implement self elevation when necessary
- Implement auto-reloading of the config file when the .ini is changed externally
- Remove the tray icon when it's getting stable
- Design it's own icon
Current version: