Solved Empty Recycle bin from Batch file?


My Computers

System One System Two

  • OS
    Windows 11 22H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell XPS8950
    CPU
    i7-12700K
    Motherboard
    Z690 : 9D2HH Foxconn, R6PCT Foxconn 2nd
    Memory
    16GB (2 x 8)
    Graphics Card(s)
    Intel(R) UHD Graphics 770 with shared graphics memory
    Sound Card
    Integrated
    Monitor(s) Displays
    Acer CBL282K Smiiprx
    Screen Resolution
    4K UHD (3840 x 2160) @ 60 Hz
    Hard Drives
    Western Digital PC SN810 512 GB M.2 NVMe SSD, PCIe
    PSU
    750W
    Cooling
    2G44F Asetek 125W CPU liquid cooler
    Keyboard
    Arteck Wireless
    Mouse
    Victsing-mm057 wireless
    Internet Speed
    Wi-Fi 6
    Browser
    Vivaldi
    Antivirus
    Windows Defender (native)
  • Operating System
    Win 22H2
    Computer type
    Laptop
    Manufacturer/Model
    Dell Vostro 5620
    CPU
    12th Gen Intel Core i7-1260P
    Memory
    2 x 8 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Screen Resolution
    1920 x 1200 @ 60 Hz
    Hard Drives
    NVMe 512 GB
    Case
    Aluminum
    Mouse
    Touchpad
    Browser
    Vivaldi
    Antivirus
    Windows Defender (native)
Thanks to Shawn, I got the Recycle Bin thing fully under control, then Firefox threw me a curve.
Unlike Edge, which is part of Windows, and is the same with every install, Firefox on the other hand is an External Program and with every install it sets its own path to it's Temporary Internet Files.

I googled to find out where Firefox stores its Temp files and the guy whose answer I saw first, gave the path to that location on his own PC. Well of course, that was not the same as the path on my PC.
So far, I've installed my cleanup batch file on four different HD's. And on every one, the path to Firefox's temp files is in a differently named directory/folder.
So, if someone is going to write their own batch file to get rid of Temporary Internet Files, that can build up faster than old newspapers,
in Win-11, here's the command for deleting the files from "MS Edge"....
Del /f /s /q "C:\Users\%Username%\AppData\Local\Microsoft\Edge\User Data\Default\Cache\Cache_Data\*.*"
That should be the same on every PC running both Edge and Windows 11.


But for Firefox, it gets a little more complicated:
Del /f /s /q "C:\Users\%Username%\AppData\Local\Mozilla\Firefox\Profiles\xxxxxxxx.default-release\cache2\entries\*.*"
where \xxxxxxxx will vary with every install of Firefox. So you'll need to look in your own PC for the numbers and letters that go in that location.
I've gone through this several times now, on different computers, and every time those 8 characters are different.
So that precludes me sharing my batch file with anyone else, and expect it to run without some Editing.
If I personally install my batch file for a friend or customer, I'll have to edit it, to conform to Firefox's temp files location on that particular PC.
I'm thinking that maybe a wild card would work for those 8 (alpha Numeric) characters, but so far, all attempts to do that have failed.
No problem. I just edit that line on each install of Win-11, where I install Firefox.

Cheers Mates!
TM :cool:
 
Last edited:

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
You realize most browsers have options to manage (clean) their own caches, instead of you doing it without their consent?
At this point, you're re-inventing CC Cleaner.
 
Last edited:

My Computer

System One

  • OS
    Windows 7
CCleaner destroyed my PC twice, years ago, before I finally put it on my 'NEVER MORE' list.

I was a DIY guy, decades before there were such things as browsers. Now, being retired and just wanting something to do, I decided to re-write my ages old XPCleanup.bat program. It's been fun, and really got me scrambling for information. A lot has changed since XP.
But, so far I've made progress, and deleted several hundred thousands of junk files of all descriptions, from this and several others of my PC's. "Minus crud is cool!"
I'm anxious to run my program on a PC that's had no maintenance for several years, and I think I know where there is one.
If there is a draw back, it's that it has to be customized for every version of Windows.

I'm kind of stopped cold for the time being. On Friday the 13th, (Jan 2023) my main PC, about seven years old, decided to commit suicide. RIP! It was the only PC in my collection, that I actually built from scratch.
Luckily, it was not my ONLY PC. I pulled the 250GB SSD, with Windows 8.1/Pro/64, and all my STUFF on it, and put it into a little HP Slimline desktop PC, that I refurbished several years ago. I had replaced the PSU with a Heavy Duty model, upgraded the ram to 4GB and replaced the CD and HD. Now it's going to run with two SSD's in it, with Win-8.1 on one drive and Win-11/Pro/64 on the other.
True to it's nature, Win-8.1 said something like "Please Wait" as it installed drivers and settled in to its now home. It's running like it was installed there. It sure abled up a lot of new space on my computer desk. ;-)
Cheers Mates!
:cool:
 

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
Did I mention, that this has been a learning experience for this 79 yr old?
Several years ago now, a good friend gave me a "Sabrent, Docking Station" that has it's own power supply and connects to the PC via a USB cable. I had not really used it very much, till this week, when I pulled it out of storage and connected it to my little HP Slimline PC which is now serving as my MAIN PC.
Almost accidently, I found out that my little HP, in its Boot Menu will boot up from any disk in the Dock, that contains a bootable OS.
I had a little 2.5" HD, with Win-11 on it sitting in the Dock, and I went into the Boot Menu and was really surprised to see that the HP was offering to boot up from "Sabrent". WOW, who would'a thunk it?
So I let it do that, and after a few moments of "Please Wait", the little HD booted up my PC to Win-11 and was running just great!
I've seen Win-8.1 do that, but not Win-11. Birds of a feather, Eh?
Docking Station.jpg
Win-11, booting up the PC from a little HD in the Docking Station.

I'm pretty sure that this is nothing new to many PC Enthusiasts on this forum, but it was all NEWS to me!
Gotta Love it!

Cheers Mates,
TM :cool:
 

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
But for Firefox, it gets a little more complicated:
Del /f /s /q "C:\Users\%Username%\AppData\Local\Mozilla\Firefox\Profiles\xxxxxxxx.default-release\cache2\entries\*.*"
where \xxxxxxxx will vary with every install of Firefox. So you'll need to look in your own PC for the numbers and letters that go in that location.
I've gone through this several times now, on different computers, and every time those 8 characters are different.
So that precludes me sharing my batch file with anyone else, and expect it to run without some Editing.
If I personally install my batch file for a friend or customer, I'll have to edit it, to conform to Firefox's temp files location on that particular PC.
I'm thinking that maybe a wild card would work for those 8 (alpha Numeric) characters, but so far, all attempts to do that have failed.
Code:
pushd "%localappdata%\Mozilla\Firefox\Profiles" && (for /f "usebackq tokens=*" %%i in (`dir /a:d /s /b "????????.default-release"`) do del /f /s /q "%%~i\cache2\entries\*.*" & popd)

To test this (without actually deleting the files) :
Code:
pushd "%localappdata%\Mozilla\Firefox\Profiles" && (for /f "usebackq tokens=*" %%i in (`dir /a:d /s /b "????????.default-release"`) do @echo del /f /s /q "%%~i\cache2\entries\*.*" & popd)
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
Thank you, and all the way from Belgium! I wouldn't have guessed it.
I can't really say I know it well, but I did spend one very nice day in Namur, back in 1964.
And, another nice day in Brussels, also in 1964, while touring Europe on my 1951 BMW motor Cycle.

Thanks for the code, it did work as I'm sure you knew it would.

Just curious though, where do you come up with such detailed code?

TM :cool:
 

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
With that new line of code installed into my cleanup batch file, I ran it just now, and it deleted 32,364 files.
There were some files that did not delete, because they were "In use". Totally expected results.
After that, I ran "Super Anti Spyware" and it deleted 22 Tracking Cookies. (That was from just two days) They do build up fast.

Thanks again,
TM :cool:
 

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
I've continued my work on my Cleanup Batch File, tweaking and tuning it day by day till today when I ran it for the first time in maybe two days.
The final report says it all.
Clean 1-27-23.jpg
That's correct...82,050 in two days (max). If that's just two days junk collection, what would it be in a year? Eh?
In my own experience as a PC tech, for many years, I've removed many Millions of junk files from my customer's PC's.
And I've restored many to like new condition, and with the addition of a few reg. tweaks, even Better Than New!

This is just a little example, of what anyone can do with just a few lines of code. A few of those lines are shown earlier in this very thread.
Like the one to clean out the Firefox temp files. That line came all the way from Belgium, thanks to 'HDMI'.
Cheers Mates,
TM :cool:
 

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
You realize most browsers have options to manage (clean) their own caches, instead of you doing it without their consent?
At this point, you're re-inventing CC Cleaner.

CCleaner is handy in many domestic environments for PC maintenence. That said, to be fair, it wasn't long ago that malware was being introduced to PCs compliments of CCleaner. Admittedly, the issue was promptly remedied but also reminds us that not all third party programs are trustworthy or even reliable. I'm not suggesting that no one use programs or aps like this, but I do advise caution. What I'm seeing in this bat file (I confess I'm no no coder) is a simple and effective way of dealing with bloatware without having to resort to more bloatware. Evidently, it's simple, streamlined, pragmatic, and does what its supposed to do without all the frills and Windows dressing. However academic, hardly a re-invention.

Now this is only a personal observation and I've stated numerous times that I'm not a hardcore software guy. As for the matter of doing things with a browser installed on my PC without the consent of the developer, well this is an old argument. Myself, I will do as I see fit with both hardware and software on my PC with or without consent. In my opinion, if I can't do what I wish with what is on my PC , or at least to attempt such a thing, then it shouldn't be on my PC. I realize this is an ownership argument and not everyone wants to have ownership of a PC. I like to think most people like the idea of owning the computers that they purchase or build and I happen to be one of them. :-)
 

My Computer

System One

  • OS
    WIN 11, WIN 10, WIN 8.1, WIN 7 U, WIN 7 PRO, WIN 7 HOME (32 Bit), LINUX MINT
    Computer type
    PC/Desktop
    Manufacturer/Model
    DIY, ASUS, and DELL
    CPU
    Intel i7 6900K (octocore) / AMD 3800X (8 core)
    Motherboard
    ASUS X99E-WS USB 3.1
    Memory
    128 GB CORSAIR DOMINATOR PLATINUM (B DIE)
    Graphics Card(s)
    NVIDIA 1070
    Sound Card
    Crystal Sound (onboard)
    Monitor(s) Displays
    single Samsung 30" 4K and 8" aux monitor
    Screen Resolution
    4K and something equally attrocious
    Hard Drives
    A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W

    Ports X, Y, and Z are reserved for USB access and removable drives.

    Drive types consist of the following: Various mechanical hard drives bearing the brand names, Seagate, Toshiba, and Western Digital. Various NVMe drives bearing the brand names Kingston, Intel, Silicon Power, Crucial, Western Digital, and Team Group. Various SATA SSDs bearing various different brand names.

    RAID arrays included:

    LSI RAID 10 (WD Velociraptors) 1115.72 GB
    LSI RAID 10 (WD SSDS) 463.80 GB

    INTEL RAID 0 (KINGSTON HYPER X) System 447.14 GB
    INTEL RAID 1 TOSHIBA ENTERPRIZE class Data 2794.52 GB
    INTEL RAID 1 SEAGATE HYBRID 931.51 GB
    PSU
    SEVERAL. I prefer my Corsair Platinum HX1000i but I also like EVGA power supplies
    Case
    ThermalTake Level 10 GT (among others)
    Cooling
    Noctua is my favorite and I use it in my main. I also own various other coolers. Not a fan of liquid cooling.
    Keyboard
    all kinds.
    Mouse
    all kinds
    Internet Speed
    360 mbps - 1 gbps (depending)
    Browser
    FIREFOX
    Antivirus
    KASPERSKY (no apologies)
    Other Info
    I own too many laptops: A Dell touch screen with Windows 11 and 6 others (not counting the other four laptops I bought for this household.) Being a PC builder I own many desktop PCs as well. I am a father of five providing PCs, laptops, and tablets for all my family, most of which I have modified, rebuilt, or simply built from scratch. I do not own a cell phone, never have, never will.
My first draft of a new and improved "Cleanup.bat" program was for Win-11, but since it's 99% finished, I've taken on Win-10 and I find that there are very few differences in where the two OS's store their junk.
Now my Win-10 Cleanup batch file is just about finished. Ten and eleven are so similar, under the hood, it doesn't take much effort to convert my little program to go from one to another.

My next job is to write a similar batch file for Win-8.1 and then if time permits, Windows 7. I have all the OS's here on various HD's so that will be no problem.

In another thread, I kept seeing "temporary internet files" mentioned over and over again, in relation to HD's filling up, but not one word about removing them. They are like potato peels, or old coffee grounds or chicken bones. Something to be gotten rid of before they start to stink!

But, unlike household garbage, those temporary files can't be used for 'Mulch'! Just get rid of them!
The three lines in my Batch Files that clean out the highest number of junk files, are the ones that get rid of those files from Firefox, Edge and Prefetch. Those three lines could be put in a very small batch file and that file could be put in the Startup Folder for a little bit of Daily Cleanup.
During boot up, that little cleanup batch file could get rid of the worse garbage from the previous day.
I have a little program called simply "TempCleaner.exe" that I put in my own Startup Folder for a little daily cleanup. It does get rid of several MB of junk every day, but it does not clean out the Temporary Internet Files. ???
Want to simply get rid of .tmp files?
This will do it:
Del /F /S /Q "C:\*.tmp"
Similar for .bac files.
And again, for .old files.

Type either of those lines into a CMD prompt, and see what I mean.
Or maybe just try all of them....one at a time, of course.

Cheers Mates!
:cool:
 
Last edited:

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
I've never understood why "Recycle Bin" is needed.
I just switch it off.
The intelligence services will be disappointed.
 

My Computer

System One

  • OS
    Microsoft Windows 11 Home
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI MS-7D98
    CPU
    Intel Core i5-13490F
    Motherboard
    MSI B760 GAMING PLUS WIFI
    Memory
    2 x 16 Patriot Memory (PDP Systems) PSD516G560081
    Graphics Card(s)
    GIGABYTE GeForce RTX 4070 WINDFORCE OC 12G (GV-N4070WF3OC-12GD)
    Sound Card
    Bluetooth Аудио
    Monitor(s) Displays
    INNOCN 15K1F
    Screen Resolution
    1920 x 1080
    Hard Drives
    WD_BLACK SN770 250GB
    KINGSTON SNV2S1000G (ELFK0S.6)
    PSU
    Thermaltake Toughpower GF3 1000W
    Case
    CG560 - DeepCool
    Cooling
    ID-COOLING SE-224-XTS / 2 x 140Mm Fan - rear and top; 3 x 120Mm - front
    Keyboard
    Corsair K70 RGB TKL
    Mouse
    Corsair KATAR PRO XT
    Internet Speed
    100 Mbps
    Browser
    Firefox
    Antivirus
    Microsoft Defender Antivirus
    Other Info
    https://www.userbenchmark.com/UserRun/66553205
You can do some nice things with the Recycle Bin in PowerShell.

Powershell:
$UnicodeEncoding = New-Object System.Text.UnicodeEncoding
$UserSID = (New-Object System.Security.Principal.NTAccount($Env:UserName)).Translate([System.Security.Principal.SecurityIdentifier]).Value
$RecycleBin = 'C:\$RECYCLE.BIN\' + $UserSID
Write-Host $RecycleBin`n
$RecycleBin += '\'
get-childitem $RecycleBin -Filter '$I*.*' | % {
  $Name = $_.Name.Substring(2)
  $R = $RecycleBin + '$R' + $Name
  if (Get-ItemPropertyValue ($R) -Name Exists) {
    $Attributes = Get-ItemPropertyValue ($R) -Name Attributes } else { $Attributes = 'ITEM_NOT_FOUND' }
  $raw = gc ($RecycleBin + $_.Name) -Raw -Encoding Byte
  $i = 0
  $j = 0
  while ($i -lt $raw.Count - 32) {
    if ($raw[$i] -eq 2) {
      $j = $i + 1
      do {
        if ($raw[$j] -eq 0) { $j += 1 } else { $i = $j; break }
      } while ($j -lt $i + 8)
      if ($j -eq $i + 8) { break } else { $j = $null } } }
  $DateDeleted = [DateTime]::FromFileTime([BitConverter]::ToInt64($raw[($j+8)..($j+15)], 0))
  $PathStringLength = [BitConverter]::ToInt32($raw[($j+16)..($j+19)], 0) * 2
  $PathString = $UnicodeEncoding.GetString($raw[($j+20)..($j+20+$PathStringLength)])
  Write-Host $DateDeleted $Attributes `"$PathString`" $Name
}
 
Last edited:

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
Now, you know darn well, that I for one, have NO idea what that's supposed to do. But I'm sure it does something spectacular!

I'd copy that, and run it on my PC, but I'm afraid that the thing would sprout legs, get up, and walk out!
Actually, I have NO idea how to run that code! (but I did copy it anyway) ;-)

My quest to write the best (not perfect, but just very good) cleanup batch file, for Win-11 went well, and that program is 99.99% finished.
Then with just a few tweaks, I had it working great on Win-10. But I had to install Win-10 to a spare HD, just to test my batch file. ;-)
But, since all my laptops (7) run Win 8.1, that's my latest job, to tweak my Cleanup Batch File to run on Windows 8.1.

So, this afternoon, I installed and ran my Windows 8.1 Cleanup batch file on an old Dell laptop in my shop. It's been sitting there for several years now, with virtually no maintenance. The program started and quickly got down to deleting the temp files from Firefox.
They scrolled off the top of the screen, for several minutes. I noticed that the temp files were consecutively numbered in HEX.
So when the scrolling stopped, I wrote down the final number. It was FFFD in HEX. In decimal, that's 65,533. And that's all just from Firefox.
For a PC that's seldom ever used, that's a lot of temp files!!! So, think of what that would be, if that PC were used every day. Yikes!
And, some folks wonder why I want to clean out my PC's. Eh?

Cheers Mates!
TM :cool:
 
Last edited:

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
The PowerShell script that I wrote should be able to run using PowerShell 5.1 on Windows 8.1 or later version of Windows. (On Windows 7 SP1, after updating the PowerShell that comes with Windows 7 to PowerShell 5, it might work also.)

For now, this script does nothing but show a complete list of deleted items that it is able to find, for the user currently logged in to Windows, in the Recycle Bin for the C: drive. The details that are shown for each deleted item on this list are:
  • the date & time when the item was deleted
  • the attributes of the item (e.g., Archive or Directory, separated by commas) or ITEM_NOT_FOUND if the item doesn't exist
  • the full path of the item's original location (between doublequotes, and formatted as Unicode)
  • the name (without the first two characters) that was given to the item in the Recycle Bin.
The first line that is shown above the list is the actual folderpath, for the user currently logged in to Windows, of the Recycle Bin for the C: drive.

I will try to write another script in PowerShell that can be used to add date-based criteria that make it perform partial cleanups of the Recycle Bin.
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
In my quest to clean all the junk out of a PC, using a simple batch file, I've finally made it down to my old install of Windows 7 Ultimate on an old eMachine.
My command line, to remove the Temporary Internet Files from Firefox would fail miserably with a "File Not Found" error.
I wrote about this phenomenon on the Win-7 forum, and "Torchwood" suggested that I try TFC.exe.
I did, and I found out that TFC not only deleted the temp files, but also the 3 directories immediately before those files.
The temp files were GONE, but so were several layers of directories. But not to worry!
Firefox just re-made those directories the next time I ran the program.

So, back to my Batch File, where I shortened the command to just eliminate those last three directories, and the command worked. WOW! I never would'a thunk it!

I don't know, what is so different between Windows 7 Ultimate, and Windows 8.1, 10 and 11, but there is definitely something.

:cool:
 

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦22631.3447 ♦♦♦♦♦♦♦23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 4702)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 13 years?
I see that the title of this topic is "emptying the Recycle Bin from a Batch file".
Thanks to another member, who is much smarter than me, that problem was solved a long time ago.
This line does it admirably:

PowerShell Clear-RecycleBin -force -ErrorAction:Ignore

It not only cleans out the Recycle Bin for drive C: , but also the Recycle Bins on all my Partitions, and all connected drives.
It's definitely one of those "Watch out, here I come! " sort of commands. It's like a Maniac with a Machine Gun, in a crowded mall.

Reminds me of the old DOS command "Deltree" , , , if not used correctly it could erase an entire partition, or an entire drive.
Our office secretary wanted to use my computer to erase some floppy disks, (this was back before Windows, when everything we did was in DOS and floppy disks were in common use) and wound up erasing my C:\ drive. Arggg!
I tried to be kind to her, but our BOSS, not so much. She almost lost her job that day.

Cheers Mate!
TM :cool:
 
Last edited:

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
Stuff happens :cool:
 

My Computer

System One

  • OS
    WIN 11, WIN 10, WIN 8.1, WIN 7 U, WIN 7 PRO, WIN 7 HOME (32 Bit), LINUX MINT
    Computer type
    PC/Desktop
    Manufacturer/Model
    DIY, ASUS, and DELL
    CPU
    Intel i7 6900K (octocore) / AMD 3800X (8 core)
    Motherboard
    ASUS X99E-WS USB 3.1
    Memory
    128 GB CORSAIR DOMINATOR PLATINUM (B DIE)
    Graphics Card(s)
    NVIDIA 1070
    Sound Card
    Crystal Sound (onboard)
    Monitor(s) Displays
    single Samsung 30" 4K and 8" aux monitor
    Screen Resolution
    4K and something equally attrocious
    Hard Drives
    A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W

    Ports X, Y, and Z are reserved for USB access and removable drives.

    Drive types consist of the following: Various mechanical hard drives bearing the brand names, Seagate, Toshiba, and Western Digital. Various NVMe drives bearing the brand names Kingston, Intel, Silicon Power, Crucial, Western Digital, and Team Group. Various SATA SSDs bearing various different brand names.

    RAID arrays included:

    LSI RAID 10 (WD Velociraptors) 1115.72 GB
    LSI RAID 10 (WD SSDS) 463.80 GB

    INTEL RAID 0 (KINGSTON HYPER X) System 447.14 GB
    INTEL RAID 1 TOSHIBA ENTERPRIZE class Data 2794.52 GB
    INTEL RAID 1 SEAGATE HYBRID 931.51 GB
    PSU
    SEVERAL. I prefer my Corsair Platinum HX1000i but I also like EVGA power supplies
    Case
    ThermalTake Level 10 GT (among others)
    Cooling
    Noctua is my favorite and I use it in my main. I also own various other coolers. Not a fan of liquid cooling.
    Keyboard
    all kinds.
    Mouse
    all kinds
    Internet Speed
    360 mbps - 1 gbps (depending)
    Browser
    FIREFOX
    Antivirus
    KASPERSKY (no apologies)
    Other Info
    I own too many laptops: A Dell touch screen with Windows 11 and 6 others (not counting the other four laptops I bought for this household.) Being a PC builder I own many desktop PCs as well. I am a father of five providing PCs, laptops, and tablets for all my family, most of which I have modified, rebuilt, or simply built from scratch. I do not own a cell phone, never have, never will.
It sure does
And I've been fighting with "Stuff" all day. You can't believe the "Stuff" I've gone through just replacing an HD in a little HP laptop, with an SSD. Fortunately, I have both the experience and the software to get the job done.

I just performed a Firefox Sync, and I'm on that little HP Laptop now.
An SSD upgrade sure makes an old laptop work a lot faster.
But, I'm not telling you nuttin'.
 

My Computer

System One

  • OS
    Win-11/Pro/64, Optimum 11 V5, 23H2 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Made w/Gigabyte mobo/DX-10
    CPU
    AMD FX 6350 Six Core
    Motherboard
    Gigabyte, DX-10, GA-78LMT-USB3
    Memory
    Crucial, 16 GB
    Graphics Card(s)
    NVIDEA GeForce 210, 1GB DDR3 Ram.
    Sound Card
    Onboard
    Monitor(s) Displays
    24" Acer
    Screen Resolution
    1280x800
    Hard Drives
    Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
    PSU
    EVGA 500 W.
    Case
    Pac Man, Mid Tower
    Cooling
    AMD/OEM
    Keyboard
    101 key, Backlit/ Mechanical Switches/
    Mouse
    Logitech USB Wireless M310
    Internet Speed
    Hughes Net speed varies with the weather
    Browser
    Firefox 64x
    Antivirus
    Windows Defender, Super Anti Spyware
    Other Info
    Given to me as DEAD, and irreparable.
    Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.
Back
Top Bottom