Tag Archives: Windows 10

How to delete the Windows.old folder

Motivation:

After a major update Windows 10 leaves a folder named Windows.old in the system drive. You may remove it to save disk space and prevent potential harmful exploits.

Solution

Method 1:

  1. Click in Windows’ search field, type Cleanup, then click Disk Cleanup.
  2. Click the “Clean up system files” button.
  3. Wait a bit while Windows scans for files, then scroll down the list until you see “Previous Windows installation(s)“.
  4. Check the box next to the entry.
  5. Click OK.

Method 2:

  1. Open a command prompt (cmd.exe) as Admin
  2. Execute 3 below commands:
takeown /f C:\Windows.old /r /d y
icacls C:\Windows.old /grant administrators:F /t
rmdir C:\Windows.old /s /q

takeown: takes ownership of a folder.

icacls: grants permissions to a user against a folder

rmdir: deletes a folder

3. If some files still cannot be deleted then please restart your computer and re-excecute the above 3 commands.

4. If some files still cannot be deleted after the restart then please execute 3 below commands:

icacls C:\Windows.old /T /Q /C /RESET
icacls C:\Windows.old /grant admin:F /t
rmdir C:\Windows.old /s /q

admin: your current logged in username.

5. If some files still cannot be deleted then please click Cortona icon, type msconfig, click on System Configuration link, click Boot tab, select Safe boot check box,  select Minimal option, click OK, restart your computer and then execute the 3 commands in the 2nd step and the 3 commands in the 4th step.

How to find a string in files

Motivation:

Find a string in all files in a directory without having to install an external program that may decrease system security.

Method 1:

  1. Open a command prompt (cmd.exe)
  2. Go to the directory and
  3. Execute below command:
find /i "search string" *.*

/i: ignores the case of your search string.

Examples:

find /i "app files were copied" *.*
find /i "were copied" *.log

Method 2:

  1. Open a command prompt (cmd.exe)
  2. Go to the directory and
  3. Execute below command:
findstr /s "search string" *.*

/s: searches for each word in your search string.

or execute below command:

findstr /C:"search string" *.*

/C: searches for exact match of your search string .

Examples:

findstr /s "Integrated Security=true" *.cs
findstr /C:"app files were copied" *.log

Quick Format vs. Full Format

Question:

What is the difference between Quick Format and Full Format?

Which option should you choose when formatting a drive?

Answer:

When you choose to run a Full Format on a volume (or partition), files are removed from the volume that you are formatting and the hard disk is scanned for bad sectors. The scan for bad sectors is responsible for the majority of the time that it takes to format a volume.

When you choose to run a Quick Format on a volume (or partition), format removes files from the partition, but does not scan the disk for bad sectors. Only use this option if your hard disk has been previously formatted and you are sure that your hard disk is not damaged.


Question:

What is the difference between MBR disk and GPT disk?

Which option should you choose when initializing a new external drive?

Answer:

MBR (Master Boot Record) disk allows you to install older operating systems. However it can only recognize up to 2TB space, and allows you to create up to 4 partitions.

GPT (GUID Partition Table) disk does not allow you to install older operating systems. However it can recognize more than 2TB space, and allows you to create more than 4 partitions.

When initializing a new external drive, probably you should initialize your disk as a GPT disk unless you want to install an old operating system on your external disk.

If you need to convert a disk to GPT while installing Windows then you can press Shift + F10 or Fn + Shift + F10 to open Command Prompt when you arrive the Windows Edition Selection screen. Then follow the procedure below.

Enter diskpart.exe, press Enter.
DISKPART> list disk
DISKPART> select disk 0 -- the disk should be selected, the number may be different in your machine.
DISKPART> clean
DISKPART> convert gpt
DISKPART> exit

In order to detect hard drive model, serial number and size use the command below.

wmic diskdrive get model, serialNumber, size

 


Problem:

How to solve Windows Server 2012 (R2) Extend Volume Greyed Out issue?

You are trying to extend partition with Disk Management snap-in Windows Server 2012 (R2), but you find the option to Extend Volume greyed out.
Solution:

Reason 1: The cause is disk partition style. Your disk partition is MBR style that supports only up to 2TB.

Solution for reason 1: Convert MBR to GPT disk for using un-allocated space beyond 2TB.

Reason 2: The un-allocated space is not contiguously behind the target partition that you want to extend.

Solution 1 for reason 2:

Step 1: Backup the partition (e.g. D:) behind the target drive (e.g. C:) you want to extend. Right-click on the D: partition and select "Delete Volume" in the drop down list.

Step 2: Once you have D: partition delete, it will turn into an unallocated space and be automatically merged with other unallocated space that is next to it if have. Now you can right-click on C: drive and "Extend Volume" option is available.
Solution 2 for reason 2:

Use a third-party application to merge the partitions, e.g. AOMEI Partition Assistant Server Edition.