Clear Temp Files


robofors

Well-known member
Local time
5:41 AM
Posts
29
Location
Australia
OS
Windows 11
Does anyone know of a script that will clear all Temp files including C:\Users\Home\AppData\Local\Temp
Thanks for your help in advance
 
Windows Build/Version
Edition Windows 11 Home Version 22H2 OS build 22621.1702 Experience Windows Feature Experience Pack 1000.22641.1000.0

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Computer type
PC/Desktop
Manufacturer/Model
HP Pavilion 620
Browser
Edge
Antivirus
Malarebytes
Other Info
EEdition Windows 11 Home
Version 22H2
Installed on ‎12/‎11/‎2022
OS build 22621.1344
Experience Windows Feature Experience Pack 1000.22639.1000.0
Hello @robofors,

You can target most temp files through the Disk clean-up gui. Just open disk clean up, select your windows drive and under “Files to delete:” deselect everything but (at the bottom) Temporary files. Personally my Temporary files were taking 2.77gb. Then click Ok, Delete files,and it will clear your temp files.

James
 

My Computers My Computers

  • At a glance

    Windows 11 21H2AMD Ryzen 3 3100Corsair 8GB x 2 (16GB)Asus Nvidia Geforce GTX 1650 Super
    OS
    Windows 11 21H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Chillblast
    CPU
    AMD Ryzen 3 3100
    Motherboard
    Asus ROG Strix b450-f
    Memory
    Corsair 8GB x 2 (16GB)
    Graphics Card(s)
    Asus Nvidia Geforce GTX 1650 Super
    Monitor(s) Displays
    Dell 27" 1440p
    Screen Resolution
    1440p
    Hard Drives
    Seagate Barracuda 1TB
    256GB NVME Seagate Barracuda
    Browser
    Firefox / Edge
    Antivirus
    Windows Defender
  • At a glance

    Windows 8.1Amd E24GB
    Operating System
    Windows 8.1
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Amd E2
    Memory
    4GB
    Hard Drives
    128GB SSD
I have attached batch script which you can use to clean temporary files.
 

Attachments

My Computer My Computer

At a glance

Windows 11AMD Ryzen 7 5700GMicron Technology DDR4-3200 16GBNVIDIA GeForce RTX 3060
OS
Windows 11
Computer type
PC/Desktop
Manufacturer/Model
HP Pavilion
CPU
AMD Ryzen 7 5700G
Motherboard
Erica6
Memory
Micron Technology DDR4-3200 16GB
Graphics Card(s)
NVIDIA GeForce RTX 3060
Sound Card
Realtek ALC671
Monitor(s) Displays
Samsung SyncMaster U28E590
Screen Resolution
3840 x 2160
Hard Drives
SAMSUNG MZVLQ1T0HALB-000H1
WOW! MS Security didn't like that at all! It was blocked, till I scrolled right and clicked the "Run Anyway" button.

Even so, it only deleted one file from one folder and in Windows there are a dozen or more Temp folders.

This little shortie will get rid of every .tmp file in your computer:
Del /F /S /Q "C:\*.tmp"
Just run it from a CMD prompt or put it in a batch file.

But then that won't get the Temporary Internet files from either Firefox or Edge (the two browsers that I use.)
You'll need a special command for each of those.
And any other browser you may use, will have its own hiding place for its temp files.

In my own Cleanup.bat program (batch file) I have 12 lines, each one addressing a different type of temp file in a different location.
OH, and there's the 13th line to empty the Recycle Bin. :lmao: Can't forget that one!

Really cleaning up one's PC isn't all that hard, it just takes fortitude and persistence.
When I'm done surfing for the day and get ready to watch some TV, I run my Cleanup.bat program and it typically deletes between 30K and 100K of junk files. And, at the end, it even prints out the total number of files deleted.

CincoDeMayo.jpg
This was another busy day at home on my PC.....Cinco de Mayo!
 
WOW! MS Security didn't like that at all! It was blocked, till I scrolled right and clicked the "Run Anyway" button.
Surely that's normal Windows behaviour for a downloaded .bat file that might make changes. Hardly a "WOW2 surely?
 

My Computer My Computer

At a glance

Windows 11 Pro 25H2 26200.8655Ryzen 5 760032 Gb DDR5 6000Hz Corsair VengeanceSapphire Pulse RX 7600
OS
Windows 11 Pro 25H2 26200.8655
Computer type
PC/Desktop
Manufacturer/Model
Home built
CPU
Ryzen 5 7600
Motherboard
Gigabyte B650M Aorus Elite AX Ice
Memory
32 Gb DDR5 6000Hz Corsair Vengeance
Graphics Card(s)
Sapphire Pulse RX 7600
Sound Card
Internal Realtek
Monitor(s) Displays
Samsung 32" Odyssey G5 G50D QHD
Screen Resolution
2560 x 1440
Hard Drives
WD Black SN 770 1Tb; SanDisk SDSSDA240G ; Seagate 2Tb HDD
PSU
MSI MAG A750GL
Case
Enermax Marbleshell MS21
Cooling
Thermaltake Peerless Assassin 120 White ARGB, 3 x 120 intake, 1 x 120 exhaust
Keyboard
Aukey KM-G12
Mouse
Razer Basilisk v3 Pro 35K
Internet Speed
1 Gb/s up & 800 Mb/s down
Browser
Brave / Edge
Antivirus
Windows / Malwarebytes
Back
Top Bottom