We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
temp file cleanup
Options

enfield_freddy
Posts: 6,147 Forumite
in Techie Stuff
I have a simple CMD file that I can run that cleans up the winsxs directory , this reads
dism.exe /online /cleanup-image /startcomponentcleanup and I run it regularly
I would like to add some extra commands (before this) , removal of temp files.
at present del /q/f/s %TEMP%\*
however this is missing a load of directories out , eg windows/temp and users/(user name)/appdata/local/temp.
my dos skills are getting rusty , can someone come up with a line that will remove all folders and files that are in ALL the temp folders on a modern machine (win 10)
empty recycle bin , and remove temp internet files would be handy as well.
when finished , I would like to save this as a simple CMD file on my pendrive , then when trying to sort out slow running families PCs , simply run this from the desktop or drop it into windows/32 and type summot like "cleanme"
this could be made available to other forum users , to help them as well
alan
dism.exe /online /cleanup-image /startcomponentcleanup and I run it regularly
I would like to add some extra commands (before this) , removal of temp files.
at present del /q/f/s %TEMP%\*
however this is missing a load of directories out , eg windows/temp and users/(user name)/appdata/local/temp.
my dos skills are getting rusty , can someone come up with a line that will remove all folders and files that are in ALL the temp folders on a modern machine (win 10)
empty recycle bin , and remove temp internet files would be handy as well.
when finished , I would like to save this as a simple CMD file on my pendrive , then when trying to sort out slow running families PCs , simply run this from the desktop or drop it into windows/32 and type summot like "cleanme"
this could be made available to other forum users , to help them as well
alan
0
Comments
-
use ccleaner instead
or lift the directories from winapp2.ini and add them to the batch file prefixed with a
rd /Q/SDon't you dare criticise what you cannot understand0 -
much as an external program can be used , it would be simpler/easier to just have a simple batch file and run it,
anyone else care to make any suggestions of decent lines of text to add?0 -
rm -rf /Science isn't exact, it's only confidence within limits.0
-
obviously not simpler and easier, because you have to create the batch file in the first place, and maintain it, there are 100's of potential locations, some require registry interrogation, and multiple user accounts.
you've been given and dismissed an easy way of creating a batch file, lift the data from the ccleaner ini file, or parse it
but the smart and simple way is to use a program designed to do it, ccleaner, which can also be run from a batch file, have your own locations, and be put on a usb stick, and someone else goes to the trouble of maintaining it.Don't you dare criticise what you cannot understand0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.7K Banking & Borrowing
- 253K Reduce Debt & Boost Income
- 453.4K Spending & Discounts
- 243.7K Work, Benefits & Business
- 598.5K Mortgages, Homes & Bills
- 176.8K Life & Family
- 256.9K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards