SOLVED Autoexec.bat

Joined
Apr 5, 2018
Messages
30
Reaction score
0
In a far past, when most computers were running on DOS, I wrote an extension to Autoexec.bat that clean the hard-disks of all clogging files before shitting down the computer.

Now, with Windows 10, my "Temp" directories are filled with all kind of crap that keep using disk space and slowing down the system.
Unfortunately, Autoexec.bat is not used anymore by Windows 10 and I need to clean my hard disk manually before I turn it off.

Windows offers a disk cleanup where one can select what files to delete (including the Recycle Bin) but that has to be done manually also.

Is there any way to call Disk Cleanup or a kind of batch file to delete the Temp directories when shutting off the computer?
Eventually a kind of batch file that can be run periodically?

TIA
 

Regedit32

Moderator
Joined
Mar 4, 2016
Messages
3,617
Reaction score
1,139
You could write a script and create a Task to execute that script via Task Scheduler, and set that task to run either at a certain time each day, or at regular intervals, or based upon an action [ e.g. upon shutdown ]. That though would slow the shut down.

Why not just use the built in Windows settings:
  • Press windows key + I to open the Settings window
  • Now click System, then on left pane click Storage
  • Then click the trash can icon next to Temporary files to delete
That takes all of 10 seconds.
 
Joined
Oct 26, 2016
Messages
2,398
Reaction score
702
Why not use storage sense which comes with Windows 10??

This is my setting:

2019-11-07_194757.jpg


and it works just fine. I hardly have to clean my SSD anymore (Diskclean)...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top