What's the best App to 'shred' items when you empty the Recycle Bin?


  1. Posts : 197
    Windows 10 v2004 build 19041.329
       #1

    What's the best App to 'shred' items when you empty the Recycle Bin?


    I had CCleaner but an MVP expert in the Microsoft Community forum strongly advised me to replace it, citing major problems following its takeover in July 2017 by Avast. He said that a few months later (September 2017?) CCleaner was compromised by hackers.

    Is CCleaner 'safe' now? If not, can you recommend alternatives, please - whether free or 'pay for'?


    Windows 10 / 1909 18363.815


    PS Will change my signature soon!!



    - - - Updated - - -

    PS I haven't a clue why there are two different fonts in my post!
      My Computer


  2. Posts : 2,487
    Windows 10 Home, 64-bit
       #2

    HD Cleaner x64 portable has a shredder built in; I've never used it.

    You should be able to run down earlier pre-Avast versions of CCleaner without a lot of trouble.

    I know that version 5.32.6129 is from Sept 2017 and is pre-Avast.

    5.39 is AFTER Avast. I'm not sure what version is the last pre-Avast.
      My Computer


  3. Posts : 19,518
    W11+W11 Developer Insider + Linux
       #3
      My Computers


  4. Posts : 99
    Windows 10 Home Version 22H2
       #4

    I have used 'Eraser' for many years. Has worked very well for me as a Recycle Bin 'shredder', and also as a way to wipe the unused disk space on my hard drive.

    Eraser – Secure Erase Files from Hard Drives
      My Computer


  5. Posts : 11,247
    Windows / Linux : Arch Linux
       #5

    Hi there

    Use anything that simply overwrites X'00' (Hex zero) in every physical sector on the appropriate file / directory. You could even create a script to do it -- get the disk geometry from Windows API, then set sector / cluster, write X'00' etc etc.

    The problem with some of the common 3rd party stuff (that's why one needs to check if these things weren't written "Donkeys years ago") is that in order to make modern file systems more efficient there's often a "Don't overwrite" deleted files until that particular physical space is needed on the HDD / SSD -- so unless your 3rd party program is actually doing PHYSICAL I/O writes rather than just using the OS's file system API then the application isn't really much use.

    Some really bad applications do use physical I/O but only overwrite the "Directory entry" to give the impression of fast speed -- it takes a while to write Hex Zero on physical sectors if file(s) are big -- so the data is really still there.

    You can check also how good these applications are (or aren't) by trying some of the data recovery programs to see if your "erased" data is still acessible !!.

    For people who want to try being Geeky

    To get Disk Geometry try this : (C++)

    BOOL DeviceIoControl(
    (HANDLE) hDevice, // handle to device
    IOCTL_DISK_GET_DRIVE_GEOMETRY, //dwIoControlCode
    NULL, //lpInBuffer
    0, // nInBufferSize
    (LPVOID) lpOutBuffer, // output buffer
    (DWORD) nOutBufferSize, // size of output buffer
    (LPDWORD) lpBytesReturned, // number of bytes returned
    (LPOVERLAPPED) lpOverlapped // OVERLAPPED structure
    );

    For an SSD :

    just run "C:\Program Files\Common Files\Microsoft Shared\MSInfo32.exe", go to "Components > Storage > Disks" and find "Partition Starting Offset". It will be in bytes, divide the number by 512 to convert into sectors.

    Now do your write X'00'

    * This program attempts to directly write to a device (without respecting the file system) */

    #include <stdio.h>
    #include <windows.h>

    BOOL dismountDisk(HANDLE hDevice);
    BOOL lockDisk(HANDLE hDevice);
    BOOL writeDisk(HANDLE hDevice);
    void getSystemMessageString(DWORD errorCode, char *decodedMessage, unsigned long size);

    /* Main function
    * Access the device
    * Dismount the device
    * Lock the device explicitly
    * Write to the device
    * Close handler
    */
    int main()
    {
    /* Access the device */
    HANDLE hDevice = CreateFileA(
    "\\\\.\\PHYSICALDRIVE2", /* device id (get it with `$ wmic DISKDRIVE`) */
    FILE_READ_DATA | FILE_WRITE_DATA, /* read/write access */
    FILE_SHARE_READ | FILE_SHARE_WRITE, /* shared */
    NULL, /* default security attributes */
    OPEN_EXISTING, /* only open if the device exists */
    0, /* file attributes */
    NULL); /* do not copy file attributes */

    if (hDevice == INVALID_HANDLE_VALUE) { /* cannot open the physical drive */
    fprintf(stderr, "Cannot open the device\n");
    } else { /* dismount and lock */
    BOOL result = dismountDisk(hDevice) && lockDisk(hDevice); /* try to dismount and lock the device */
    if (!result) { /* device not dismounted/locked */
    abort(); /* abort the operation */
    } else { /* OK */
    fprintf(stderr, "All OK. Check if the device has been dismounted and locked and press return to write.\n");
    getchar();
    writeDisk(hDevice); /* write to the disk */
    }
    CloseHandle(hDevice); /* close the handler to the device */
    }

    return 0;
    }

    /* Dismount disk */
    BOOL dismountDisk(HANDLE hDevice)
    {
    DWORD unused;
    BOOL b = DeviceIoControl(hDevice, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &unused, NULL);
    if (!b) {
    DWORD errorCode = GetLastError();
    char strBuff[500] = {0}; /* save the error message here */
    getSystemMessageString(errorCode, strBuff, 500);
    fprintf(stderr, "Error dismounting the device: [%lu] %s\n", errorCode, strBuff); /* print the error code and message */
    }
    return b;
    }

    /* Lock disk */
    BOOL lockDisk(HANDLE hDevice)
    {
    DWORD unused;
    BOOL b = DeviceIoControl(hDevice, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &unused, NULL);
    if (!b) {
    DWORD errorCode = GetLastError();
    char strBuff[500] = {0}; /* save the error message here */
    getSystemMessageString(errorCode, strBuff, 500);
    fprintf(stderr, "Error locking the device: [%lu] %s\n", errorCode, strBuff); /* print the error code and message */
    }
    return b;
    }

    /* Write disk */
    BOOL writeDisk(HANDLE hDevice)
    {
    BYTE buffer[1000]; /* write 100 bytes */
    DWORD bytesWritten; /* to get the total amount of bytes written */
    BOOL b = WriteFile(hDevice, buffer, sizeof (buffer), &bytesWritten, NULL);
    if (!b) {
    DWORD errorCode = GetLastError();
    char strBuff[500] = {0}; /* save the error message here */
    getSystemMessageString(errorCode, strBuff, 500);
    fprintf(stderr, "Error writting the device: [%lu] %s\n", errorCode, strBuff); /* print the error code and message */
    } else {
    fprintf(stderr, "%lu bytes written.\n", bytesWritten);
    }
    return b;
    }

    /* Convert the error code returned by GetLastError into a human-readable string */
    void getSystemMessageString(DWORD errorCode, char *decodedMessage, unsigned long size)
    {
    FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
    NULL, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    decodedMessage, size + 1, NULL);
    SetLastError(0); /* clear the last error */
    }

    "Seemples"

    Test first using alternative HDD to your main Windows C drive of course -- I'm rusty these days on programming.

    Cheers
    jimbo
    Last edited by jimbo45; 03 May 2020 at 05:40. Reason: Added code for Disk Geometry and write to disk
      My Computer


  6. Posts : 6,856
    22H2 64 Bit Pro
       #6

    ignatzatsonic said:
    HD Cleaner x64 portable has a shredder built in; I've never used it.

    You should be able to run down earlier pre-Avast versions of CCleaner without a lot of trouble.

    I know that version 5.32.6129 is from Sept 2017 and is pre-Avast.

    5.39 is AFTER Avast. I'm not sure what version is the last pre-Avast.
    HD Cleaner works fine.

    What's the best App to 'shred' items when you empty the Recycle Bin?-recycle-bin.jpg

    Also Ccleaner works fine if you tweak it.

    EDIT:

    What's the best App to 'shred' items when you empty the Recycle Bin?-sharpapp.jpg

    Code:
    [HKEY_CURRENT_USER\Software\Piriform\CCleaner]
    "Monitoring"="0"
    "HelpImproveCCleaner"="0"
    "SystemMonitoring"="0"
    "UpdateAuto"="0"
    "UpdateCheck"="0"
    "CheckTrialOffer"="0"
    "(Cfg)QuickClean"="0"
    "(Cfg)HealthCheck"="0"
    "(Cfg)GetIpmForTrial"="0"
    "(Cfg)SoftwareUpdater"="0"
    "(Cfg)SoftwareUpdaterIpm"="0"
    Code:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Piriform\CCleaner]
    "UpdateAuto"="0"
    "UpdateCheck"="0"
    "CheckTrialOffer"="0"
    "(Cfg)GetIpmForTrial"="0"
    "(Cfg)SoftwareUpdater"="0"
    "(Cfg)SoftwareUpdaterIpm"="0"
    "Monitoring"="0"
    "HelpImproveCCleaner"="0"
    "SystemMonitoring"="0"
    "(Cfg)QuickClean"="0"
    "(Cfg)HealthCheck"="0"
    Last edited by Callender; 03 May 2020 at 08:48.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:35.
Find Us




Windows 10 Forums