Wednesday, May 24, 2017

Free Up Hard Drive Space - Updated!

I've figured out a way to clear out any temporary files and folders that Windows uses by using automated batch files. Batch files are simple computer command executions that run through the Windows command line prompt that is similar to DOS.

Step 1 - Enable viewing of hidden folders and files, and unhide file extensions.
We are enabling viewing of the hidden folders so that we can access a certain folder where temporary files are stored so that they can be deleted by the batch files later. We also want to unhide extensions so we can clearly see what type of files we have. This will enable us to rename a text file extension and turn it into a batch file extension instead.

--> For Windows 10 and Windows 8 - open any drive or folder on your computer.
--> click on the menu "View" --> "Options" --> click on the tab "View"
--> at the bottom of that window look for items with checkboxes and make sure the option beside "Show hidden folders, files, and drives" is checked with a black circle beside it.
--> uncheck the checkbox beside "Hide extensions for known file types".
Click on the "Apply" button and then the "OK" button to close it.

--> For Windows 7 - open any drive or folder on your computer.
--> click on the menu "Organize" --> select "Folder and search options" --> click on the tab "View"
--> at the bottom of that window look for items with checkboxes and make sure the option beside "Show hidden folders, files, and drives" is selected with a black circle beside it.
--> uncheck the checkbox beside "Hide extensions for known file types".
Click on the "Apply" button and then the "OK" button to close it.


Step 2 - Find your main User Account Name.
- Browse to your main Operating System hard drive which is usually the C:/ drive for most people.
     ---> then open the "Users" folder
     ---> then look for the main user name of the computer. The list will look something like this:
               - Default
               - UserName
               - LocalService
               - NetworkService
               - Public
     ---> the main user name in this case is "UserName" but it will be different on your own computer.
     ---> make a note of it because we are going to use it when editing the first batch file so that it works.

        
 Step 3 - Create Batch File 1
--> press windows key+R, then type "notepad" without the quotation marks and press enter to open the Notepad Application.

Then copy the following text within the dotted lines and paste it into Notepad:
--------------------------------------------------------
@ ECHO OFF

Set dir=C:\Users\UserName\AppData\Local\Temp

Echo Deleting all files from %dir%
del %dir%\* /F /Q

Echo Deleting all folders from %dir%
for /d %%p in (%dir%\*) Do rd /Q /S "%%p"
@echo Folder deleted.

exit
--------------------------------------------------------
Then change UserName to what your main account user name is.
--> go to File menu --> Save --> name it "clear temp app data.txt" and save it in a spot you can remember. Desktop is usually a good location.
Next you need to convert the file into a batch file.
--> Click on the name of the file once so that the cursor appears and you can edit the text.
--> delete the .txt extension and type in .bat to replace it. The file should now be named
clear temp app data.bat


Step 4 - Create Batch File 2
--> press windows key+R, then type "notepad" without the quotation marks and press enter to open the Notepad App.

Then copy the following text within the dotted lines and paste it into Notepad:
--------------------------------------------------------
@ ECHO OFF

Set dir=C:\Windows\Temp

Echo Deleting all files from %dir%
del %dir%\* /F /Q

Echo Deleting all folders from %dir%
for /d %%p in (%dir%\*) Do rd /Q /S "%%p"
@echo Folder deleted.

exit
--------------------------------------------------------

--> go to File menu --> Save --> name it "clear windows temp data.txt" and save it in a spot you can remember. Desktop is usually a good location.
Next you need to convert the file into a batch file.
--> Click on the name of the file once so that the cursor appears and you can edit the text.
--> delete the .txt extension and type in .bat to replace it. The file should now be named
clear windows temp data.bat


Step 5 - Copy the Batch Files to Windows Startup
--> find where you saved both batch files "clear temp app data.bat" + "clear windows temp data.bat" and select them both.
--> right-click and select "copy"
--> press the Windows Key + R key together
--> type "shell:startup" without the quotation marks and press the "Enter" key. This will open the Windows startup Folder.
--> right-click anywhere in the folder and select "paste"
--> close all open windows.
--> That's it folks. Now every time that Windows starts up or when your computer reboots, temporary files and folders will be safely deleted and will free up hard drive space automatically. Restart your computer to test it out.

No comments:

Post a Comment