SOLVED Autoexec.bat


Joined
Apr 5, 2018
Messages
6
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
 
Ad

Advertisements

Regedit32

Moderator
Joined
Mar 4, 2016
Messages
3,368
Reaction score
1,042
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
May 6, 2015
Messages
2,452
Reaction score
380
I must admit that I would just buy a bigger SSD and ignore the problem!
 
Joined
Oct 26, 2016
Messages
1,634
Reaction score
442
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)...
 
Ad

Advertisements


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