These two buttons provide a replacement for the Windows Recycle Bin on USB flash drives and mapped network drives — the standard Windows Recycle Bin mostly does not work on such drives. I originally wrote them because VeraCrypt didn't delete to the Recycle Bin from mounted drives, but that turned out to be a temporary bug, now fixed, see [url]How to test whether a drive is a mounted drive?] .
Installation:
Download the two files, set DOpus to "Customise", and drag the files to a convenient toolbar or toolbar menu.
Configuration — The "Deletion" button:
The "Deletion" button will probably require three adjustments. Hold down the Alt key and RightClick on it — the text of the button will be displayed and the lines to be edited are clearly at the top of the file.
- THE "ForDeletion" DIRECTORY: There are two possibilities:
- A "ForDeletion" directory may be created on each drive (omit the drive from the path for this option). With this option, the "ForDeletion" directory will have the same name and location on every drive, but it need not be on the root directory. OR
- A single "ForDeletion" directory may be created for all drives (include a drive in the path for this option).
-
MAXIMUM NUMBER OF DELETIONS: There is a safety limit of 100 items deleted at the one time. This can be edited.
-
DRIVES THAT WILL USE THE WINDOWS RECYCLE BIN: Fixed drives should be able to use the Windows Recycle Bin already, so there is no real need for these buttons there. Edit the list of such drives, including C: drive. For these drives, the "Deletion" button will simply carry out the normal DOpus "Delete" command.
Configuration — The "Restoration" button:
The "Restoration" button also has a maximum number of restores, which can be changed from its default 100.
It is convenient to have a button to go to the "ForDeletion" directory. The command to so this when there is such a directory on each drive is "Go {SourcePath|}" .
Using the two buttons:
On any drive to which the buttons apply, select the files or directories to be deleted and press "Deletion". These items will removed to the "ForDeletion" directory. The date now is added to the name to prevent duplicates, then the date now, the date modified, and the original location, are stored in the "User Description" metadata field, then the item is given back its original date modified, then it is moved. To restore these items, go to the "ForDeletion" directory, select them and press the "Restoration" button. They will be restored to their original location with their original name and date modified.
It is useful to add the column "User Description" permanently to the columns of the "ForDeletion" directory. This can be done using the command "Properties FolderOptions", which is already a button in the standard DOpus Menu toolbar.
Restrictions and possibilities:
-
The "ForDeletion" directory must be on an NTFS drive because data needs to be added to the User Description metadata field on deletion and read back on restoration. If a USB has been formatted FAT, then one would need to use a single "ForDeletion" directory on a fixed drive of the computer.
-
Any USB will need to be given a fixed letter using Control Panel - - > System and Security - - > Administrative Tools - - > Create and Format Hard Disk Partitions (Disk Management), otherwise the drive letter may change at reboot or when the USB is inserted again. Similarly, network drive letters cannot change between deletion and restoration.
-
A single "ForDeletion" directory may or may not be more convenient, but of course it would be completely insecure when being used for deletions from an encrypted drive.
-
CCleaner allows user-defined directories, in this case the "ForDeletion" directories, to be added to its cleaning routine. If the "ForDeletion" folder is on a different drive, however, remnants of files may remain until chance overwriting occurs.
-
It would not be hard to specify differently-named "ForDeletion" directories for certain drives and leave a default directory for the other drives, if that is needed.
-
This system does not work on network drives that are not mapped to a drive letter. I could probably add that also if it is needed.
-
There may be a better place in the metadata to store the file details. I chose the "User Description" rather than creating a new field.
As always, thanks to @leo and @tbone for advice and encouragement.
Version 1.1, 12/10/15:
Now applies to unmapped network drives + more flexibility + minor bug fix
See post below.
Deletion.dcf (40.4 KB) Restoration.dcf (8.65 KB)
Version 1.0, 09/10/15:
Deletion.dcf (15.1 KB) Restoration.dcf (8.2 KB)