I've got a Windows XP batch script which cleans some directories, but I would like to move the deleted files to trash instead of using plain del
. How is this done?
It looks like the only languages I can use for this is plain batch or Perl.
Here's how you can open the Recycle Bin using the Run command dialog box: Press the Windows key + R to open the Run command dialog box. Type shell:RecycleBinFolder in the search bar and then press Enter. Alternatively, type shell:RecycleBinFolder and then press Enter.
There is "DeleteXP.exe" is for deleting files from Command Prompt in Windows (Windows 9x and Windows NT 4.0/2000/XP). Unlike, the standard "DEL" command which only deletes the file, Delete XP deletes the files and sends them to the recycle bin. The file(s) to be deleted are passed to it as parameters.
The del command is used to delete one or more files from the command line without sending them to the Recycle Bin. The del options are: filename. Specifies the file(s) to delete.
use Win32::FileOp qw(Recycle);
Recycle(@ARGV);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With