###### tags: `clean` `windows` # How to clean up data in computer ? The article is mainly on windows and still keep update (if i find other better ways). Since size of memory is fixed, as a developer, I think that it's important to have sense of keeping computer clean and to have high performance for work. #### Outline : 1. Delete 2. Clean temp file 3. Some tips ## :dart:1. Delete **Here are some methods if you try to delete or remove something but don't work. If you just want to clear your computer, just jumpt to [2.Clean-temp-file](#2-Clean-temp-file)** ### Method (1) Check if the application or file being used - check if you're still using that file, close it if yes and deletion may work - How to know I'm using that file - press `ctrl` + `shift` +`esc` - open task manager : just turn off the file or application you want to delete ![](https://i.imgur.com/aYYwu2F.png) ### Method (2) Use command line I think this method works efficiently for those situation that just can't find out why cannot delete the file :) - How to use cmd? - press `windows` + `R` and type ==cmd== ![](https://i.imgur.com/EmSMenx.png) - see what's in directory : type `dir` ![](https://i.imgur.com/IYwQJk6.png) - go to directory : type `cd [test_directory]` ![](https://i.imgur.com/rxd3mH3.png) - go back last directory : type `cd ..` ![](https://i.imgur.com/A2EIuOn.png) - delete the file : type `del [file name]` ![](https://i.imgur.com/Ao8Bjhs.png) - delete the directory : type `rmdir [directory name]` - there's a director named **test** in C:\Users\i5-VivoB\test_directory ![](https://i.imgur.com/hwnu9NA.png) - delete directory **test** : type `rmdir test` ![](https://i.imgur.com/i8C2NdU.png) - then type `dir` see if successful :) ### :warning:Method (3) Create .bat file to do it:warning: **:warning: Use this method if method(1) and method (2) don't work :warning: I do not recommend this method in common situation because it's really dangerous if delete the wrong file. :warning: There guys may say just press `ctrl`+`z` to recover it. The problem is that this file will delete it forever that even `ctrl`+`z` can't help to recover. :warning: Therefore, make sure which is target file if you use this method.** - Create a ==.text== file, name it whatever. And type these in it ``` DEL F A Q %1 RD S Q %1 ``` - Save it as .bat file ![](https://i.imgur.com/Fs8TXkg.png) - :warning:Delete file : just drag the file you want to delete to .bat file (here filename is file_del.bat) created just now ![](https://i.imgur.com/d9y4rmS.png) - and the file just disappear forever :warning: even `ctrl`+`z` don't work to recover it ![](https://i.imgur.com/s8aOJ60.png) - I recommend to put it in a directory to avoid drag file on it by mistake. Or just delete it if there's no need of it. ![](https://i.imgur.com/A2sQslB.png) ## :dart:2. Clean temp file - press `windows`+`R` and type `%tmp%` ![](https://i.imgur.com/vJoayHN.png) - You'll see files in this directory. These are temporary files created by system and have no impact or use for user. ![](https://i.imgur.com/198WJ86.png) - Just select all(`ctrl`+`A`) file and delete ## :dart:3. Some tips :four_leaf_clover:These are some tips that I delete file. Welcome to have a look :four_leaf_clover: - Simplest : clean trash can make sure you don't need files in trash can and just remove them since they also occupy the memory of your computer - Delete **.exe** file - :heavy_check_mark:After installing the application, actually there's no need of .exe file. Therefore, I prefer to remove it. - :negative_squared_cross_mark:If you did put it in ==environment variable==, then don't remove it! - Check **Downloads** regularly - Well, just clean files in it - To have a good management of large amount of files, I prefer to categorize files into specific directory instead of leaving them in **Downloads** ## Reference :paperclip:[【逐步教學】在Windows電腦強制刪除檔案的6個有效方法](https://tw.imyfone.com/pc-tips/how-to-force-delete-a-file/?gclid=Cj0KCQjw48OaBhDWARIsAMd966C_-FPgD3coKu6HmimVVtrjR4NMb-chqy6h5evYzA_0NcuvQdr23owaAquZEALw_wcB) :paperclip: [dare not remove files?](https://www.youtube.com/watch?v=UGbJEAhrVWg&list=LL&index=12)