in reply to Re^2: Command to Empty Recycle Bin with Perl?
in thread Command To Empty Recycle Bin With Perl?

Hello sphinxy09,

rd (a synonym for rmdir) is the MS-DOS command to remove a directory. Without the /s option, the directory must be empty. The /s option:

Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree. (http://www.computerhope.com/rmdirhlp.htm)

No need to substitute a drive letter for %systemdrive%, that shell variable will already be set for the current command line session. Enter set systemdrive (or just set) from a command line to verify this; for example, I see:

0:11 >set systemdrive SystemDrive=C: 0:11 >
My local hard disk is comprised of the C: drive and E: drive, and regardless of a file's original location (C: or E: drive) if I delete it, it moves to the Recycle Bin.

I can’t test this, but my understanding is that each partition (regardless of its physical location) has its own Recycle Bin. Since Windows Vista, this has the location: Drive:\$Recycle.Bin (see Trash_(computing)#Microsoft_Windows). The contents of the desktop recycle bin are not necessarily the same as the contents of any one of these Recycle Bin directories.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,