Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I move files to the Recycle Bin in a Windows batch script or Perl?

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.

like image 467
l0b0 Avatar asked Jun 30 '09 09:06

l0b0


People also ask

What is the Run command for Recycle Bin?

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.

How do I move files from the Recycle Bin to command prompt?

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.

Does DEL command Use the Recycle Bin?

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.


1 Answers

use Win32::FileOp qw(Recycle);
Recycle(@ARGV);
like image 102
FMc Avatar answered Sep 20 '22 07:09

FMc