# Freeing disk space using junctions

If you need to reclaim disk space, first you should read my previous post about Freeing disk space.
Now I’ve to warning you that the following steps are for advanced users.

What is a junction or a symbolic link? Check this wiki page.

To create a junction i’m going to use a tool named MKLINK.

I’m only going to create two junctions because those are the ones that I use, other junctions can be created but I encourage you to read on the internet more about that folder and if it’s possible to create a junction to that folder.

The first folder I’m going to create a junction is the C:\Windows\Installer. This folder contains all the applications install packages in your computer. To create a junction to this folder:

1. Move folder C:\Windows\Installer to D:\[somefolder] in my case D:\Junctions\Windows\Installer
2. After moving the folder open command prompt and type mklink /J “C:\Windows\Installer” “D:\Junctions\Windows\Installer”
3. The previous command will create the junction from C:\Windows\Installer to D:\Junctions\Windows\Installer

The second folder I’m going to create a junction is the C:\ProgramData\Package Cache. This folder is used by Visual Studio and as the name implies it’s used for cache. To create a junction to this folder:

1. Move folder C:\ProgramData\Package Cache to D:\[somefolder] in my case D:\Junctions\ProgramData\Package Cache
2. After moving the folder open command prompt and type mklink /J “C:\ProgramData\Package Cache” “D:\Junctions\ProgramData\Package Cache”
3. The previous command will create the junction from C:\ProgramData\Package Cache to D:\Junctions\ProgramData\Package Cache

At this point you should have reclaim lots of disk space. If you know any other want to reclaim disk space just comment the post.

# Freeing disk space

If you have a small disk , for example an 128GB SSD, you will very quickly run out of space. In this simple post I will show what you can do to reclaim disk space.

• Clean Recycle Bin, this is obvious
• Disk Cleanup, this is obvious
• Right click on a drive in Windows Explorer, next click on Properties menu item and then on Disk Cleanup button

• Clean up, system files, this is not so obvious
• If you see on that Disk Cleanup window you will see the button Clean up system files.
• If you had Windows 7 then you updated to Windows 8 and then to Windows 8.1 and then to Windows 10 you will have in your machine lots and lots of useless crap and lots and lots of less disk space.
• This is also true for Windows Updates

• Next, while you are on that window, click on the tab More Options
• Here you will find two buttons Clean up in the following sections
• Programs and features
• Uninstall every program you don’t need.
• System Restore and Shadow Copies
• Remove every thing you don’t need it

• Disable Hibernation
• Hibernation uses as much disk space as you have RAM. For example if you have 8GB of RAM you will have lost 8GB of disk space.
• To disable hibernation open command prompt as Administrator and execute the following command “powercfg.exe /hibernate off”

• Disable System Restore (advanced users)
• Open Advanced System Settings and then click on the tab System Protected
• If you don’t need System Restore, System Protected and all those fancy stuff that uses lots  of disk space, disable it.

• Open Advanced System Settings and then click on the tab Advanced and then button Settings… Next click on Advanced tab and on the Change… button in Virtual memory section.
• Here you can control how your Virtual memory is managed. If don’t want to use automatic settings you can change it to manual and you can even choose the drive where you want to store your swap file.

• Clean Temp files
• Open Windows Explorer and type %TEMP% in the address bar and delete all files and folders, because they are temporary and that’s why the are stored in temp folder. Also you might want to check the C:\Windows\Temp

• Clean Temporary ASP.NET Files (Advanced users)
• If you are a .Net developer you probably want to check Temporary ASP.NET Files and clean this folder. These are the folders you might want to check
• C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
• C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
• C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
• C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files
• Clean browser cache
• All browsers, IE, Chrome, Firefox, etc… they all store on your disk files like (images, css, javascript, html, etc…) these files are temporary and exists to “speed up” sites rendering. This way the browsers don’t need to fetch everything every time you visit a site.
• Every browser have a Clean browsing data button in browser Settings.

• Use WinDirStat or TreeSize or any similar tool
• These tools let you know where are you loosing space and eventually you can reclaim some space

• Compress Drive
• If you use NTFS it’s possible to use drive compression and save some space. In Windows Explorer right click on a drive and choose the properties menu item

• Compress Folder
• If you don’t want to compress a drive and just want to compress a folder, right click on the folder you want to compress and click on properties. Here you have the Advanced… button. Next a window will open and you will have an option to compress folder content.

• Use CCleaner  or any similar tool
• Most of the manual steps that I’ve explained in this post are automatically done by some tools like CCleaner.

At this point you should have reclaim lots of disk space. If you know any other want to reclaim disk space just comment the post.

To disable Server Manager automatically startup when you logon into a Windows Server just follow this steps:

Start Server Manager
Click on Manage menu (top right)
Click Server Manager Properties

Check Do not start Server Manager automatically at logon
Click Ok button

And that’s it, the next time you start Server Manager it will not start automatically.

# Antimalware Service Executable high CPU

Today I noticed that my computer fan was running more than normal, Windows Explorer become unresponsive and basically the computer wasn’t normal. I took a look at Task Manager and Process Explorer and I noticed that Antimalware Service Executable wasn’t normal and was using about 30% CPU.

I found that strange and first I tried to kill the process, but unfortunately  I can’t kill it. Then I tried stop Windows Defender Service, but I can’t stop this service. Then I reboot the computer and the problem was the same…

After a while I did a google search to see if someone else had the same problem. I’ve found that this is a common problem with lots of possible solutions.

The solution that worked for me was:

1º  Open Windows Defender

2º Go to settings\Administrator and uncheck “Turn on this app” and then save settings

3º Now you will have warning messages in Windows TaskBar.

4º Open Action Center

5º Click on button “Turn on now” to turn on Windows Defender.

And after this steps for some reason my computer CPU is again normal.

# Windows 8.1 Tip to disable and re-enable hibernate

Many users like me need hibernate and found that wasn’t enabled by default.

After goggling I’ve found a command line command that does the enable and disable of hibernate.

First open the command line with administrative privileges then execute the following command:

To turn off hibernate type in the command line powercfg.exe /hibernate off
To turn on hibernate type in the command line powercfg.exe /hibernate on

Recently I was goggling for an app (for free) that allows the download of a web site for offline reading and then I came across a StackOverflow post that says use Wget.

Before start using Wget you will need to download Wget. I recommend always the latest version and you can get it for Windows from here.

Now to download a web site you will need to combine several arguments and the result would be:

wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains mydomain.com --no-parent http://www.mydomain.com/site

If you want to know the definition of each arguments just type wget –help or check the wget manual page.

# Install a clean Windows 8.1 install with a Windows 8 key

As you might already know you can update your windows 8 to windows 8.1 without the need of a new product key but you can’t install a clean windows 8.1 using windows 8 product key.

Well this is not entirely true and I will teach you how to do that.

The first thing you need to do is Create a Windows 8.1 Bootable USB device.

Next you will need to locate the folder sources inside your USB device with windows 8.1 installation. :\sources

Then create a new text document with the name ei.cfg

Enter the following content in ei.cfg:

[EditionID] Professional [Channel] Retail [VL] 0

Now boot your computer and start the windows 8.1 installation.
During the installation you will need to insert a product key. Use the your windows 8 product key.

Wait the installation to finish and you will have a clean windows 8.1 installation with a windows 8 product key.

# Create a Windows 8.1 bootable USB device

In these days it’s very common that computers/laptops don’t have a optical drive. Because of this it’s no surprise that when you need to install Windows 8.1 you will need a USB device, such as a flash drive.
This was my case, I recently needed to installed Windows 8.1 and I didn’t have a optical drive. So I needed to find a way. In the next  steps I will teach you how to do that.

The first thing you need is a USB device, such as a flash drive.
The last thing you need is how to create a windows 8.1 bootable USB device.

The last part it’s easy thanks to the Windows Installation Media Creation Tool. This is the only tool you will need.

When you run the Windows Installation Media Creation Tool for the first time you will be presented with the following screen:

In this screen you need to choose the language, the windows 8.1 edition and the architecture. Then click in the Next button.
In the next screen you need to choose that you want to save the installation file to the USB flash drive. Then click in the Next button.
If you want you can save it to an ISO and then burn the ISO to a optical drive such as a DVD.

In the next screen you choose the USB flash drive. Then click in the Next button.

In the last screen you need to wait the download and the creation of windows 8.1 bootable USB device.

After this last step you will be ready to install windows 8.1.

# Import CSV in MySql Workbench

This is a quick tip on how to import a csv with data into one of your tables.

1º Open MySql Workbench

2º run the following query

On linux:

load data local infile ‘/path/to/your/file.csv’ into table dbName.tableName fields terminated by ‘,’ enclosed by ‘”‘ lines terminated by ‘\n’;

On Windows

load data local infile ‘c:\\path\\to\\your\\file.csv’ into table dbName.tableName fields terminated by ‘,’ enclosed by ‘”‘ lines terminated by ‘\n’;

# Visual Studio 2012 connecting to TFS

This is what happen to Visual Studio 2012 when connecting to TFS…

Mental note: Use MessageBox, it’s a thing that exists since windows was created.