Jump to content

cache files

MrMcMuffinJr

Hello dudes, I don't know if this is the correct place to put this but I'm trying to backup my user folder but first i'm trying to delete shit out of it taht I don't need like cache/temp files. My question is...Is there a batch/PS script I can create that will seek any folder in my user directory with the word cache or temp within it's name and delete the files within them? I am at work rn so anything to try when I get home will be appreciated.

Favorite Threads: PSU Tier List

 

My Stuff n' Things

Spoiler

The Beast (My Rig)   |CPU: AMD Ryzen 9 3900X|  |Cooling: Enermax Liquimax III, 6x 120mm Noctua Redux|  |Motherboard:  MSI MPG B550 Gaming Plus|  |RAM: 4x32gb 3200 G.Skill TridentZ NEO|  |Graphics Card: EVGA(RIP) GeForce RTX 3070TI FTW3|  |Power Supply: Corsair CX-M 750W|  |Case: Corsair 4000D Airflow Mid Tower Case(Black)|  |SSD: 1Tb WD BLACK NVMe, 500gb NVMe, 1Tb Samsung 850 EVO|  |Monitor: MSI Optix MPG341QR 34" Ultrawide|  |Keyboard: Logitech G815|  |Mouse: Logitech G203 LIGHTSYNC|  |Audio Interface: FiiO K7 DAC/Amp|  |Headphones: Sennheiser HD6XX |Webcam: Logitech C920, Logitech C270|

 

My Network Rack  |Switch: Cisco Dell PowerConnect 5548P|  |Router: Unifi USG|  |Rack: 12U|  |Server: HP Z420|  |Services: Proxmox PVE, Wireguard, Pihole, NVR, NAS|

 

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, mariushm said:

Have you tried Disk Cleanup  (start , run/search , disk cleanup , right click and run as adminstrator)

 

Also Piriform CCleaner : https://www.ccleaner.com/ccleaner/download

 

I thought that just cleared basic things like browser and system temp

Favorite Threads: PSU Tier List

 

My Stuff n' Things

Spoiler

The Beast (My Rig)   |CPU: AMD Ryzen 9 3900X|  |Cooling: Enermax Liquimax III, 6x 120mm Noctua Redux|  |Motherboard:  MSI MPG B550 Gaming Plus|  |RAM: 4x32gb 3200 G.Skill TridentZ NEO|  |Graphics Card: EVGA(RIP) GeForce RTX 3070TI FTW3|  |Power Supply: Corsair CX-M 750W|  |Case: Corsair 4000D Airflow Mid Tower Case(Black)|  |SSD: 1Tb WD BLACK NVMe, 500gb NVMe, 1Tb Samsung 850 EVO|  |Monitor: MSI Optix MPG341QR 34" Ultrawide|  |Keyboard: Logitech G815|  |Mouse: Logitech G203 LIGHTSYNC|  |Audio Interface: FiiO K7 DAC/Amp|  |Headphones: Sennheiser HD6XX |Webcam: Logitech C920, Logitech C270|

 

My Network Rack  |Switch: Cisco Dell PowerConnect 5548P|  |Router: Unifi USG|  |Rack: 12U|  |Server: HP Z420|  |Services: Proxmox PVE, Wireguard, Pihole, NVR, NAS|

 

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, MrMcMuffinJr said:

Is there a batch/PS script I can create that will seek any folder in my user directory with the word cache or temp within it's name and delete the files within them? I am at work rn so anything to try when I get home will be appreciated.

PS> Remove-Item -path c:\Users\* -include *cache*,*temp* -recurse -force -whatif

Should be something like this... the '-whatif' will make it show you what it would have deleted so you can test it. Remove the '-whatif' to actually delete stuff. Will need to be run from Powershell with admin. priv.

 

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, WWicket said:

PS> Remove-Item -path c:\Users\* -include *cache*,*temp* -recurse -force -whatif

Should be something like this... the '-whatif' will make it show you what it would have deleted so you can test it. Remove the '-whatif' to actually delete stuff. Will need to be run from Powershell with admin. priv.

 

Not really on topic but I just like how Windows went with whatif rather than dry-run

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

On 10/30/2019 at 12:30 PM, vorticalbox said:

Not really on topic but I just like how Windows went with whatif rather than dry-run

I'll try when I get home

Favorite Threads: PSU Tier List

 

My Stuff n' Things

Spoiler

The Beast (My Rig)   |CPU: AMD Ryzen 9 3900X|  |Cooling: Enermax Liquimax III, 6x 120mm Noctua Redux|  |Motherboard:  MSI MPG B550 Gaming Plus|  |RAM: 4x32gb 3200 G.Skill TridentZ NEO|  |Graphics Card: EVGA(RIP) GeForce RTX 3070TI FTW3|  |Power Supply: Corsair CX-M 750W|  |Case: Corsair 4000D Airflow Mid Tower Case(Black)|  |SSD: 1Tb WD BLACK NVMe, 500gb NVMe, 1Tb Samsung 850 EVO|  |Monitor: MSI Optix MPG341QR 34" Ultrawide|  |Keyboard: Logitech G815|  |Mouse: Logitech G203 LIGHTSYNC|  |Audio Interface: FiiO K7 DAC/Amp|  |Headphones: Sennheiser HD6XX |Webcam: Logitech C920, Logitech C270|

 

My Network Rack  |Switch: Cisco Dell PowerConnect 5548P|  |Router: Unifi USG|  |Rack: 12U|  |Server: HP Z420|  |Services: Proxmox PVE, Wireguard, Pihole, NVR, NAS|

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×